wordcloud2 icon indicating copy to clipboard operation
wordcloud2 copied to clipboard

How to export a wordcloud2 output as an high-resolution image?

Open FV83 opened this issue 6 years ago • 8 comments

I have created a nice word cloud with wordcloud2 but the exported png file has a bad resolution when I print it (on a big A3 sheet) - same when I zoom in a bit too much on the screen. To save the output as an image, I used the "Export/save as image" in the Rstudio viewer. I also tried via saveWidget (save as html) and webshot (convert html to png) but the resolution is also low. I have tried with grDevices::png or grDevices::tiff, where you can control for the resolution, but I get a blank image (works with wordcloud but not wordcloud2). Is there another possibility I should try?

FV83 avatar Jul 20 '18 13:07 FV83

I had the same issue. Hope it could be fixed/enhanced soon.

courageup avatar Aug 14 '18 02:08 courageup

Having similar issues. Using a custom mask for mine, but I can get it to work within webshot only if I don't use the custom mask. With the custom mask, it's completely blank.

ldlpdx avatar Aug 22 '18 17:08 ldlpdx

Having the same issue. Anyone come up with a solution? I'm trying to use this wordcloud as a figure in a publication, so unless I can get appropriate resolution it's a no-go.

patkelly3189 avatar Oct 15 '18 19:10 patkelly3189

Having the same issue. First, I can't export vectorgram file such as eps, svg and emf. Second, words failed to fill in the custom mask.

xiaofan1991 avatar Dec 25 '18 14:12 xiaofan1991

i think none is working to resolve this issue... Exporting WordCloud2 plot into high resolution png/jpg file (such as 1280x800 size)

imanojkumar avatar Sep 23 '19 14:09 imanojkumar

Solved by #8?

krlmlr avatar Jan 24 '20 15:01 krlmlr

Going through the same problem in 2020. Could anyone please share if this issue has been resolved?

alexhwang0919 avatar Oct 16 '20 00:10 alexhwang0919

No, this issue hasn't been resolved. Even using the twitter mask and the demo data from the package, I can't export the image created in the RStudio plotting window. It is really frustrating. The code I tested with is here:

figPath2 <- system.file("examples/t.png", package = "wordcloud2")
tw <- wordcloud2(data = demoFreq, figPath = figPath2, color = "random-light", shuffle = FALSE)
tw
saveWidget(tw,"tmp.html", selfcontained = F)
webshot("tmp.html","test-cloud.pdf", delay = 5, vwidth = 480, vheight = 480)

reblake avatar Jan 26 '21 22:01 reblake