scale the figures to fit the page width and height

Post date: Dec 9, 2011 6:13:51 PM

Rather than fixing the dimension of figures (e.g., [width=1in]), which might not be so flexible when changing the paper size, I found that scaling the figures with respect to the width or height of the paper is way more convenient. Only 3 things to remember:

  1. A page is normalized such that its width and height are at most 1, and it is a good practice to allow the figure portion to occupy at maximum only 0.9 of the whole width or length.
  2. The width scale can be determined using the command \linewidth. For example, if we want 2 figures to fit within 0.9 width portion of the page, we would assign the width 0.45 equally for each figure.
  3. The height scale can also be determined using the command \textheight in a similar manner to the \linewidth.

Example1

The first 2 figures are fit within the 0.9 page-width portion and followed below by 3 figures fit within the 0.9 page-width portion.

\begin{figure*}
\centering
    
\subfloat[Group1]{\includegraphics[width=0.45\linewidth]{./figures/fig1}}
\subfloat[Group2]{\includegraphics[width=0.45\linewidth]{./figures/fig2}} \\
\subfloat[Group3]{\includegraphics[width=0.3\linewidth]{./figures/fig3}}
\subfloat[Group4]{\includegraphics[width=0.3\linewidth]{./figures/fig4}}
\subfloat[Group5]{\includegraphics[width=0.3\linewidth]{./figures/fig5}}
\caption[Caption in the figure content.]{Caption in details.}
\label{fig:results}
\end{figure*}

Example2

The 3 figures fit within 0.7 of the page-height portion with the scale 0.2, 0.2 and 0.3 for figure1, 2 and 3, respectively. In this example, the remaining 0.2 (=0.9-(0.2+0.2+0.3)) of the page-height portion is preserved for the caption.

\begin{figure*}
\centering
\subfloat[Group1]{\includegraphics[height=0.2\textheight]{./figures/fig1}} \\
\subfloat[Group2]{\includegraphics[height=0.2\textheight]{./figures/fig2}} \\
\subfloat[Group3]{\includegraphics[height=0.3\textheight]{./figures/fig3}} \\
\caption[Caption in the figure content.]{Caption in details.}
\label{fig:results}
\end{figure*}