14

I have the following code for plotting a word cloud, and am getting the subsequent error.

wordcloud(dm$word, dm$freq, scale=c(8,.2),min.freq=2,
+           max.words=Inf, random.order=FALSE, rot.per=.15, colors=rainbow

>Warning message:
In wordcloud(dm$word, dm$freq, scale = c(8, 0.2), min.freq = 2,:health insurance could not be fit on page. It will not be plotted. Unable to view plot.

I do not understand why this is happening. Please help.

costebk08
  • 1,299
  • 4
  • 17
  • 42
Sridevi Vadapalli
  • 161
  • 1
  • 2
  • 5

3 Answers3

14

Try with smaller scale, for example:

wordcloud(Election2016Corpus, max.words =100,min.freq=3,scale=c(4,.5), 
           random.order = FALSE,rot.per=.5,vfont=c("sans serif","plain"),colors=palette())
Sotos
  • 51,121
  • 6
  • 32
  • 66
amit sehrawat
  • 141
  • 1
  • 3
6

You may also try plotting with a larger device, for example

dev.new(width = 1000, height = 1000, unit = "px")
wordcloud(...)

see the link for other ways to plot a certain size.

qwr
  • 9,525
  • 5
  • 58
  • 102
1

wordcloud2(dm) might work. you can install wordcloud2 package and just one

张淑婷
  • 11
  • 1
  • Hi, welcome to Stack Overflow! Please visit the [Help Center](https://stackoverflow.com/help) and read about [how to write a good answer](https://stackoverflow.com/help/how-to-answer). Your post doesn't provide an answer to the question. It's more a comment. – Joey Apr 15 '19 at 01:42
  • 1
    BEWARE, wordcloud2 suffers from the same problem but drops words that don't fit silently. – Allen Baron Apr 06 '22 at 14:54