You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I would like to know if it's possible to adjust the horizontal alignment of figures in knitr beyond fig.align? I would like to be able to make the following plot align so that the gray graph panel is centered with the paragraphs. Thanks so much for any help.
\documentclass{article}
\usepackage[margin=1in]{geometry}
\begin{document}
\noindent Here is a paragraph. Here is a paragraph. Here is a paragraph.
Here is a paragraph. Here is a paragraph. Here is a paragraph.
Here is a paragraph. Here is a paragraph. Here is a paragraph.
Here is a paragraph...
<<echo=FALSE, fig.align='center', fig.height=6, fig.width=6>>=
library(ggplot2)
bp <- ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot()
bp
@
\noindent Here is a paragraph. Here is a paragraph. Here is a paragraph.
Here is a paragraph. Here is a paragraph. Here is a paragraph.
Here is a paragraph. Here is a paragraph. Here is a paragraph.
Here is a paragraph...
\end{document}
The text was updated successfully, but these errors were encountered:
I'm afraid the best advice I could offer at the moment is to put the legend at the bottom or top of the graph: http://docs.ggplot2.org/current/theme.html (search for legend.position on the page) knitr does not allow arbitrary position of the plot directly, although you can always hack the plot hook (if you understand what this means...)
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
Hi, I would like to know if it's possible to adjust the horizontal alignment of figures in
knitr
beyondfig.align
? I would like to be able to make the following plot align so that the gray graph panel is centered with the paragraphs. Thanks so much for any help.The text was updated successfully, but these errors were encountered: