quanteda / quanteda.textplots

Plotting and visualisation for quanteda
GNU General Public License v3.0
6 stars 1 forks source link

Add parameters to textplot_wordcloud to control padding #17

Open enzedonline opened 2 years ago

enzedonline commented 2 years ago

Requested feature

Padding (i.e. the whitespace surrounding the plot) is currently quite large:

image

The margins parameter for me was a bit confusing until I realised it was referring to variable margins rather than plot margins. I tried to control it using par and adding a ggplot theme layer to set margins to zero, neither of these have an effect.

A simple padding = c(t, r, b, l) would be great to control the amount of whitespace surrounding the plot, or by other method.

Code for the above example:

textplot_wordcloud(dfmat_ns, max_words = 400, random_order = F, 
                   fixed_aspect=F, rotation = 0, 
                   color = brewer.pal(9, 'Set1'), random_color = T,
                   )