I' d like to ask some help on how to reduce the amount of white space in a waffle chart using the waffle package in R.
Here's the code:
waffle(table(dat$Age.Group),
rows=5,
title="Demographic Age Groups")
Then it shows this:
When I knitt it, it takes too much space, refer to the picture:
I'd like to put the text closer to the plot so it won't look awkward, and so I can fit more waffle charts in one page.
I really haven't tried anything, except changing the spacing between the squares, but that doesn't seem to be the problem. I've also looked up similar problems, but I can't find anything addressing to the removing of the margin.
Thank you so much in advance!

The issue is that
waffleusescoord_equalunder the hood. As a result the size of the plot is not adjusted to fill the size of the output device. If the size of the output device is larger than needed for the plot it is filled up with white space.One option would be to set
equal=FALSEinwaffle. However, in that case you will no longer get squares but rectangles.Second option would be to reduce the size or the height of the output device via chunk options, i.e. the size used by
Rmarkdownorknitrto render your plot which by default is a 7 x 7 inches. To this end you could setfig.heightor as an alternative set the aspect ratio usingfig.asp: