4

I want to put 3 images in LateX such as 2 figures are side by side horizotally and 3rd figure below these 2 side by side figures but in middle.

I have following code:

begin{figure}[H]
 \centering
  \begin{minipage}{.5\textwidth}
   \centering
  \includegraphics[width=.50\linewidth]{Text/Images/Genelec_8010_AP.jpg}
 \captionof{figure}{Genelec 8010 AP}
 \label{fig:Genelec 8010}
 \end{minipage}%
 \begin{minipage}{.5\textwidth}
  \centering
   \includegraphics[width=.69\linewidth]{Text/Images/Genelec_8020_CPM.jpg}
   \captionof{figure}{Genelec 8020 CPM}
   \label{fig:Genelec 8020}
  \end{minipage}%
  \end{figure}

%%Here is my 3rd picture code

\begin{figure}
 \centering
 \includegraphics[width=5cm]{Text/Images/Genelec_8030_BPM.jpg}
 \caption{Genelec 8030 BPM}
 \label{fig:Genelec 8030}
 \end{figure}

I want to ask how can i modify this code so that i got figures in a style i described earlier.

8
  • There should be 3 different captions? If not, you can use \includegraphics 3 times inside the same figure environment, 2 on the same row, and the last below using \\
    – Sigur
    Commented Nov 23, 2018 at 14:42
  • YES 3 DIFFERENT CAPTIONS FOR 3 different pics Commented Nov 23, 2018 at 14:43
  • can u help me with code? Commented Nov 23, 2018 at 14:43
  • What you need is subfigure.
    – Sigur
    Commented Nov 23, 2018 at 14:44
  • actually 2 figures side by side with different captions and then third picture below these 2 side by side pic at centre Commented Nov 23, 2018 at 14:45

5 Answers 5

5

Like this?

enter image description here

\documentclass{article}
\usepackage{subfig,graphicx,showframe}
\begin{document}

\begin{figure}\centering
\subfloat[legend]{\label{a}\includegraphics[width=.45\linewidth]{example-image-a}}\hfill
\subfloat[legend]{\label{b}\includegraphics[width=.45\linewidth]{example-image-b}}\par 
\subfloat[legend]{\label{c}\includegraphics[width=.45\linewidth]{example-image-c}}
\caption{my fig}
\label{fig}
\end{figure}

\end{document}
0
1

It should be noted that subfigure captions are different from figure captions. If you want to have figure captions, use minipages.

\documentclass{article}
\usepackage{graphicx,showframe}
\begin{document}

\listoffigures

\begin{figure}[htp]% [H] is so declass\'e!
\centering
\begin{minipage}{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
\caption{figure caption}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-b}
\caption{figure caption}
\end{minipage}\par
\vskip\floatsep% normal separation between figures
\includegraphics[width=0.45\textwidth]{example-image-c}
\caption{figure caption}
\end{figure}

\end{document}

demo

1

I see no problem; \captionof is not needed because you are in a figure environment.

I'd align the two top figures at their bottom, so the captions are aligned. Probably they should use the same width (or the same height).

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htp]

\centering

\begin{minipage}[b]{.5\textwidth}
\centering
\includegraphics[width=.50\textwidth]{example-image-a}
\caption{Genelec 8010 AP}\label{fig:Genelec 8010}
\end{minipage}%
\begin{minipage}[b]{.5\textwidth}
\centering
\includegraphics[width=.69\textwidth]{example-image-b}
\caption{Genelec 8020 CPM}\label{fig:Genelec 8020}
\end{minipage}

\bigskip

\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=.69\textwidth]{example-image-c}
\caption{Genelec 8030 BPM}\label{fig:Genelec 8030}
\end{minipage}

\end{figure}

\end{document}

enter image description here

1

With subcaption:

\documentclass{article} 
\usepackage{subcaption} 
\usepackage{showframe}% for testing purpose only 
\usepackage{graphicx} 
\begin{document} 
\begin{figure}[htp]
\centering\begin{subfigure}[b]{0.5\linewidth} 
\centering\includegraphics[width=.5\linewidth]{example-image-a} 
\caption{\label{fig:Genelec 8010}Genelec 8010 AP} 
\end{subfigure}\hfill
\begin{subfigure}[b]{0.5\linewidth} 
\centering\includegraphics[width=.69\linewidth]{example-image-b} 
\caption{\label{fig:Genelec 8020}Genelec 8020 CPM} 
\end{subfigure}\vspace{10pt}

\begin{subfigure}[b]{\linewidth} 
\centering\includegraphics[width=5cm]{example-image-c} 
\caption{\label{fig:Genelec 8030} Genelec 8030 BPM} 
\end{subfigure} 
\caption{A caption for the three figures together} 
\end{figure} 
\end{document}

enter image description here

0

One option using the subfig package:

\documentclass{article}
\usepackage{subfig,graphicx}
\begin{document}

\begin{figure}

\begin{minipage}[b]{.5\linewidth}
\centering
\subfloat[][Genelec 8010 AP]{\label{Genelecs:Genelec 8010 AP}\includegraphics[width=.50\linewidth]{example-image-a}}
\end{minipage}%
\begin{minipage}[b]{.5\linewidth}
\centering
\subfloat[][Genelec 8020 CPM]{\label{Genelecs:Genelec 8020 AP}\includegraphics[width=.69\linewidth]{example-image-b}}
\end{minipage}\par\medskip
\centering
\subfloat[][Genelec 8030 BPM]{\label{Genelecs:Genelec 8030 AP}\includegraphics[width=5cm]{example-image-c}}

\caption{my fig}
\label{fig:Genelecs}
\end{figure}

\end{document}

enter image description here

4
  • i want to give caption to each figure separately Commented Nov 23, 2018 at 15:02
  • Yes, add a second bracket [..] with each subcaption, see my edit.
    – AboAmmar
    Commented Nov 23, 2018 at 15:04
  • inside subfloat[] command or after that Commented Nov 23, 2018 at 15:05
  • The sub-captions are written inside the second bracket [] for subfloat as: \subfloat[][<subcaption>]{..}, see my answer.
    – AboAmmar
    Commented Nov 23, 2018 at 15:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .