2

I have to add 8 figures on one page using subfigure command in such a way that first 4 figures should be placed with one caption and next 4 figures with other caption. Please guide me with sample of a code, how shall i do?? The example is shown in below attached figure: enter image description here

  • Hi and welcome to TeX. SX. Have you already tried a bit? Can you show us the code you have so far? This shows everyone that you're putting effort into this yourself, which generally increases your chances of finding help – sheß May 24 '16 at 12:05
  • 1
    Well, why not use two figure environments with 4 subfigures each? – Alenanno May 24 '16 at 12:09
  • Actually, you can put multiple figure \captions in a single figure (not to be confused with subfigure captions). Nor do you really need any of the many subfigure environments available. – John Kormylo May 24 '16 at 14:04
1

You can put two minipage environment, each with it's own \caption and four \subcaptionbox commands into one figure, if they should not float onto different pages:

\documentclass{article}

\usepackage{subcaption}
\usepackage{mwe}% for example-image

\begin{document}
\begin{figure}
  \begin{minipage}{\linewidth}\centering
    \subcaptionbox{First}{\includegraphics[height=5em,width=.48\linewidth]{example-image-a}}
    \subcaptionbox{Second}{\includegraphics[height=5em,width=.48\linewidth]{example-image-b}}
    \subcaptionbox{Third}{\includegraphics[height=5em,width=.48\linewidth]{example-image-c}}
    \subcaptionbox{Forth}{\includegraphics[height=5em,width=.48\linewidth]{example-image}}
    \caption{This is the first figure}
  \end{minipage}

  \bigskip
  \begin{minipage}{\linewidth}\centering
    \subcaptionbox{First}{\includegraphics[height=5em,width=.48\linewidth]{example-image-a}}
    \subcaptionbox{Second}{\includegraphics[height=5em,width=.48\linewidth]{example-image-b}}
    \subcaptionbox{Third}{\includegraphics[height=5em,width=.48\linewidth]{example-image-c}}
    \subcaptionbox{Forth}{\includegraphics[height=5em,width=.48\linewidth]{example-image}}
    \caption{This is the second figure}
  \end{minipage}
\end{figure}
\end{document}

enter image description here

But if they should be allowed to float onto different pages, you can simply use two figures:

\documentclass{article}

\usepackage{subcaption}
\usepackage{mwe}% for example-image

\begin{document}
\begin{figure}
  \centering
  \subcaptionbox{First}{\includegraphics[height=5em,width=.48\linewidth]{example-image-a}}
  \subcaptionbox{Second}{\includegraphics[height=5em,width=.48\linewidth]{example-image-b}}
  \subcaptionbox{Third}{\includegraphics[height=5em,width=.48\linewidth]{example-image-c}}
  \subcaptionbox{Forth}{\includegraphics[height=5em,width=.48\linewidth]{example-image}}
  \caption{This is the first figure}
\end{figure}

\begin{figure}
  \centering
  \subcaptionbox{First}{\includegraphics[height=5em,width=.48\linewidth]{example-image-a}}
  \subcaptionbox{Second}{\includegraphics[height=5em,width=.48\linewidth]{example-image-b}}
  \subcaptionbox{Third}{\includegraphics[height=5em,width=.48\linewidth]{example-image-c}}
  \subcaptionbox{Forth}{\includegraphics[height=5em,width=.48\linewidth]{example-image}}
  \caption{This is the second figure}
\end{figure}
\end{document}

two figures

1

you can have two captions in one float. with use of subfig packages the solution ca be:

\documentclass{article}

\usepackage{subfig}
\usepackage{graphicx}

\begin{document}
\begin{figure}[htbp]
  \centering
    \subfloat[First]{\includegraphics[height=7em,width=.45\linewidth]{example-image-a}}
    \hfil
    \subfloat[Second]{\includegraphics[height=7em,width=.45\linewidth]{example-image-b}}

    \subfloat[Third]{\includegraphics[height=7em,width=.45\linewidth]{example-image-c}}
    \hfil
    \subfloat[Forth]{\includegraphics[height=7em,width=.45\linewidth]{example-image}}
    \caption{This is the first figure}

  \bigskip
    \subfloat[First]{\includegraphics[height=7em,width=.45\linewidth]{example-image-a}}
    \hfil
    \subfloat[Second]{\includegraphics[height=7em,width=.45\linewidth]{example-image-b}}

    \subfloat[Third]{\includegraphics[height=7em,width=.45\linewidth]{example-image-c}}
    \hfil
    \subfloat[Forth]{\includegraphics[height=7em,width=.45\linewidth]{example-image}}
    \caption{This is the second figure}
\end{figure}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.