I often encounter a situation where I would like to fit two or three figures on one page.
I define my figures as follows:
\begin{figure}[htpb]
\centering
\includegraphics[width=0.xx\linewidth]{images/filename.png}
\caption{Caption}
\label{fig:tag}
\end{figure}
The xx
value depends on the size of the image I'm using and it takes some trial and error to find the optimal value. With square graphs xx=50
approximately.
I am looking for a way to avoid the trial and error part. I assume I need to use something else than \linewidth
, but I don't know what.
Updates:
I've tried 0.5\pageheight
instead of \linewidth
but this is not satisfactory. I can fit two images on one page even if I use 0.6\pageheight
for the size of each image. This is in landscape mode though.
This is not logical to me as that would mean the two images together would span 1.2 times the height of the page.
I've also tried to set my height of the image in portrait mode just to test. I've set height=0.5\textheight
and height=0.5\paperheight
but both generate images that are too large to fit together on one page.
Best Answer
The following example assumes that the images can be scaled to the half of the text height, then the example measures the height of the captions and calculates the available height for the images.
Result with paper size A5 and rules instead of images:
Remarks: