I would like to align the plot with the center of the page of the created knitr pdf document. I can horizontally align the graph with the center using fig.align='center' , but I cannot figure out how to get the graph vertically aligned in the center.
I used the following code:
--- header-includes: \usepackage{graphicx} output: pdf_document geometry: left=1in,right=1in,top=1in,bottom=1in --- ```{r,fig.align='center',out.extra='angle=90', echo=FALSE} library(ggplot2) ggplot(diamonds, aes(y=carat, x=price, colour=clarity))+geom_point()+ facet_wrap(~cut) ```
source share