Data Science Desktop Survival Guide
by Graham Williams
We can fine tune the size of the figure to suit the document and presentation. In this example we have asked R to widen the figure from 7 inches to 14 inches using fig.width=. The code chunk is:
Underneath, knitr is using a PDF device on which the plot
is generated, and then saved to file for inclusion in the final
document. The PDF device grDevices::pdf(), by default, will generate
a 7 inch by 7 inch plot (see
Notice that as a consequence of the figure being larger the fonts have remained the same size, resulting them appearing smaller now when we include the figure in the same area on the printed page.