I am writing an article and I have to display figures side by side. I used the commands from the following link How to order 3 images horizontally? to do that. However, the figures are numbered in sequence, eg. Figure 1, Figure 2 Figure 3. I would like all of them to be part of same figure 1 and have subsections as (a) , (b) and (c).
-
1Welcome to TeX.SX! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question.– egregMar 15, 2014 at 16:40
2 Answers
You could also use the subcaption
package and its subfigure
environment. The following example sets up the subfigures so that they occupy the full width of the textblock. It also assumes that the graphs associated with each subfigure are all equally wide; if that's not the case, simply adjust the widths of the subfigure
s appropriately.
\documentclass{article}
\usepackage{subcaption}
\usepackage[demo]{graphicx} % omit 'demo' for real document
\begin{document}
\begin{figure}
\begin{subfigure}{0.31\textwidth}
\includegraphics[width=\linewidth]{fig_a.pdf}
\caption{First subfigure} \label{fig:1a}
\end{subfigure}%
\hspace*{\fill} % maximize separation between the subfigures
\begin{subfigure}{0.31\textwidth}
\includegraphics[width=\linewidth]{fig_b.pdf}
\caption{Second subfigure} \label{fig:1b}
\end{subfigure}%
\hspace*{\fill} % maximizeseparation between the subfigures
\begin{subfigure}{0.31\textwidth}
\includegraphics[width=\linewidth]{fig_c.pdf}
\caption{Third subfigure} \label{fig:1c}
\end{subfigure}
\caption{A figure that contains three subfigures} \label{fig:1}
\end{figure}
\end{document}
You can use subfig
package:
\usepackage{subfig}
\begin{figure}[htbp]
\subfloat[subfig-a's caption]{\includegraphics[height=1.8in]{...}}
\subfloat[subfig-b's caption]{\includegraphics[height=1.8in]{...}}
\subfloat[subfig-c's caption]{\includegraphics[height=1.8in]{...}}
\caption{...}
\end{figure}
-
-
1