GeneralProblem with fitting multiple figures on page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
zomgbroken
Posts: 6
Joined: Sat Oct 04, 2008 2:06 pm

Problem with fitting multiple figures on page

Post by zomgbroken »

I'm trying to get a few figures to fit onto 1 page, however, unless I make the scale really small, they won't fit, even though visually I can tell that it would definitely fit into 1 page.

The code I'm using is the below, repeated 4 times, for 4 figures.

Code: Select all

\begin{figure}[h]
\caption{}
\begin{center}
\includegraphics[scale=.7]{f.pdf}
\end{center}
\end{figure}
Can anyone help make me fit a few of these figures onto 1 page.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Problem with fitting multiple figures on page

Post by php1ic »

Try using subfigures instead of four separate figures. Include the subfigure package at the start of your document then input the figures as below

Code: Select all

\begin{figure}[htb]
\begin{center}
\subfigure[$sin(x)$]{\includegraphics[width=0.45\textwidth]{sine.eps}}
\subfigure[$cos(x)$]{\includegraphics[width=0.45\textwidth]{cosine.eps}}\\
\subfigure[$sin^2(x)$]{\includegraphics[width=0.45\textwidth]{ss.eps}}\hfill
\subfigure[$cos^2(x)$]{\includegraphics[width=0.45\textwidth]{cs.eps}}
\caption{An example of subfigures, either normally separated, or forced as far apart as possible.}
\end{center}
\end{figure}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Problem with fitting multiple figures on page

Post by gmedina »

php1ic wrote:...Include the subfigure package at the start of your document...
subfigure is an obsolete package and shouldn't be used anymore. In its stead, you can use the subfig package or, better yet, the subcaption package.

Now I am a little busy, but in some hours (if no other user has answered) I can post several alternatives to solve the original problem.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Problem with fitting multiple figures on page

Post by gmedina »

Hi zomgbroken,

you want the four figures to appear in a specific location, so it doesn't make sense to treat them as floats. You can use a recent version of the caption package and minipages to place the four figures with their corresponding captions; take a look at the following simple example (of course, modify the options for the \includegraphics commands according to your needs):

Code: Select all

\documentclass{article}
\usepackage{caption}
\usepackage[demo]{graphicx}% demo option to make the example compilable
                           % for every one. Delete the option in your actual 
                           % document
\usepackage{lipsum}% just to automatically generate some text

\begin{document}

\lipsum[1-6]
\clearpage

\noindent\begin{minipage}{\linewidth}
  \centering
  \includegraphics[height=.20\textheight]{image1}
  \captionof{figure}{first figure.}
  \label{fig:fig1}
\end{minipage}
\begin{minipage}{\linewidth}
  \centering
  \includegraphics[height=.20\textheight]{image2}
  \captionof{figure}{second figure.}
  \label{fig:fig2}
\end{minipage}
\begin{minipage}{\linewidth}
  \centering
  \includegraphics[height=.20\textheight]{image3}
  \captionof{figure}{third figure.}
  \label{fig:fig3}
\end{minipage}
\begin{minipage}{\linewidth}
  \centering
  \includegraphics[height=.20\textheight]{image4}
  \captionof{figure}{fourth figure.}
  \label{fig:fig4}
\end{minipage}

\clearpage

\lipsum[1-4]
\end{document}
If you want them to appear as four subfigures, then let me know and I can suggest you some possibilities.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
shankha
Posts: 1
Joined: Sat Jun 20, 2015 12:49 pm

Re: Problem with fitting multiple figures on page

Post by shankha »

Hi gmedina,

I had similar kind of problem. Since my document has subfigures as well, I would like to know how to use the minipage option (as u mentioned) for efficiently fitting subfigures as well.

Hope to hear from you soon.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Problem with fitting multiple figures on page

Post by Johannes_B »

Hi and welcome,

can you elaborate a bit? The example code by Gonzalo does not help you? As mentioned, package subcaption can help you a lot here.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply