I'm trying to change the size of a wordcloud
but I don't know how to do this. Apparently lower values of fig.width
make the plot bigger, not smaller, and vice versa. It seems to take up an enormous amount of space, compared to the second plot which is just the right size.
\documentclass{report}
\begin{document}
<<echo=FALSE,message=FALSE,warning=FALSE,fig.width=3>>=
library(wordcloud)
set.seed(1)
freq<-sample(letters,2000,prob=1:26,rep=T)
wordcloud(names(table(freq)),table(freq),min.freq=60,colors=brewer.pal(6,"Dark2"),scale=c(1,.2))
@
<<echo=FALSE,warning=FALSE>>=
library(ggplot2)
freq<-table(freq)
wf<-as.data.frame(freq)
wf$freq<-ordered(wf$freq,levels=wf$freq[order(wf$Freq)])
ggplot(subset(wf,Freq>60),aes(freq,Freq)) +
geom_bar(stat="identity") +
theme(axis.text.x=element_text(angle=45,hjust=1))
@
\end{document}