Problem
ggplot2 / knitr forces graphics (in LaTeX) to have a default aspect ratio. Two sections, which have a different number of faces, lead to the fact that the graphs with the heights of the faces differ. It is unpleasant.

I was looking for a solution that controls ggplot2 chamfer height regardless of the number of line facets.
Edited September 9: The solution should work within the same fragment, since both graphs are in the same fragment (as in the code example). Thus, adjusting the parameters of the cube associated with the figure is not viable, since the piece option is applied to both graphs equally.
Solution - but with problems
By placing each graph in a gridExtra square and scaling its height with the number of faces, the results in the heights of the face that no longer differ are more pleasant, but not perfect.
- Subjects appear on the page with too much margin, even where the text remains below, so the plots will move closer.
- It seems that the plots handled by this are cropped.
Is there a smarter and more reliable solution that controls the height of the ggplot2 face regardless of the number of line facets?
\documentclass[a4paper]{article} \usepackage[margin=1in]{geometry} \begin{document} <<setup, results='asis', message=FALSE, echo=FALSE>>= require(ggplot2) require(gridExtra)
pdf Output: 

r knitr ggplot2
user2030503
source share