34

I'd like my figures to be one on top of the other, rather than next to each other, so that they are larger and spread along the page width. How do I do this? Here is my code:

\begin{figure}[H]
\centering
   \begin{subfigure}[b]{0.3\textwidth}
   \includegraphics[width=0.8\textwidth]{Nvariousg1}
   \caption{}
   \label{fig:Ng1} 
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
   \includegraphics[width=0.8\textwidth]{Nvariousg2}
   \caption{}
   \label{fig:Ng2}
\end{subfigure}
\caption{(a) Numerical solutions for the small-time system with a constant-curvature body shape showing the scaled leading-order veritcal reaction force $N_0$ versus the scaled body mass $M$ for various values of $g$. Again, $I=M$ for definiteness and $A=0.7$. (b) As for (a) but over a wider range of values of $M,I$.}
\end{figure}
46

Since you're looking to make the two graphs larger, you could (a) increase the widths of the two subfigure environments to, say, 0.75\textwidth and (b) set the widths of the graphs to 1\linewidth, i.e., to the full width of the enclosing subfigure environments. LaTeX will automatically insert a line break between the two subfigures.

Example of two figures stacked on top of each other

\documentclass{article}
\usepackage{subcaption}
\usepackage[demo]{graphicx}  % remove 'demo' option for your real document

\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.55\textwidth}
   \includegraphics[width=1\linewidth]{Nvariousg1}
   \caption{}
   \label{fig:Ng1} 
\end{subfigure}

\begin{subfigure}[b]{0.55\textwidth}
   \includegraphics[width=1\linewidth]{Nvariousg2}
   \caption{}
   \label{fig:Ng2}
\end{subfigure}

\caption[Two numerical solutions]{(a) Numerical solutions for the small-time system 
with a constant-curvature body shape showing the scaled leading-order veritcal 
reaction force $N_0$ versus the scaled body mass $M$ for various values of $g$. 
Again, $I=M$ for definiteness and $A=0.7$. (b) As for (a) but over a wider range of 
values of $M,I$.}
\end{figure}
\end{document}
  • Seems like parts here are deprecated. 0.55 appears above/below the entire figure, so does a and b. – jibo Mar 19 '18 at 15:53
  • @jibo - I'm afraid I have no idea what you're talking about. For sure, I see no "0.55" appearing anywhere, and "(a)" and "(b)" show up right where they're supposed to show up, viz., below the respective graphs. Please clarify what you're experiencing – Mico Mar 19 '18 at 15:57
  • It's hard to explain without pictures. Running the demo code as you provided yielded no problems. However as soon as adding own picture files what I explained above appeared. There might be some compatibility issue with another package that I am using, don't know which though. I managed to solve the issue by using \subfloat instead of \begin{subfigure} – jibo Mar 19 '18 at 16:49
  • Are you maybe loading both subcaption and subfig (or subfigure)? If that’s the case, all bets are off. Load either subfig or subcaption, but not both. – Mico Mar 19 '18 at 17:01
  • 1
    Yes subfigure was loaded in addition to subcaption. That was what caused the troubles, so now it is working fine (just by disabling one of them). – jibo Mar 27 '18 at 11:59
5

An other option is provided here.

\documentclass[smallextended]{svjour3}
\usepackage{lipsum}% Just for this example
\usepackage{graphicx}
\begin{document}

See Figure~\ref{fig:myfig}(a) or~(b). \lipsum[1]

\begin{figure}
  \centering
  \begin{tabular}{@{}c@{}}
    \includegraphics[width=.7\linewidth,height=75pt]{example-image-a} \\[\abovecaptionskip]
    \small (a) An image
  \end{tabular}

  \vspace{\floatsep}

  \begin{tabular}{@{}c@{}}
    \includegraphics[width=.6\linewidth,height=100pt]{example-image-b} \\[\abovecaptionskip]
    \small (b) Another image
  \end{tabular}

  \caption{This is a figure caption}\label{fig:myfig}
\end{figure}

\lipsum[2]

\end{document}
  • how to label 1.1(a) and 1.1(b). Mean to say ...how would you label each of the subfigures? – rudresh dwivedi Oct 12 '18 at 7:10
1

Just add '\\' between the subfigures.

\begin{figure}[H]
\centering
   \begin{subfigure}[b]{0.3\textwidth}
   \includegraphics[width=0.8\textwidth]{Nvariousg1}
   \caption{}
   \label{fig:Ng1} 
\end{subfigure}

\\

\begin{subfigure}[b]{0.3\textwidth}
   \includegraphics[width=0.8\textwidth]{Nvariousg2}
   \caption{}
   \label{fig:Ng2}
\end{subfigure}
\caption{(a) Numerical solutions for the small-time system with a constant-curvature body shape showing the scaled leading-order veritcal reaction force $N_0$ versus the scaled body mass $M$ for various values of $g$. Again, $I=M$ for definiteness and $A=0.7$. (b) As for (a) but over a wider range of values of $M,I$.}
\end{figure}
  • 2
    If you're introducing blank lines, that surely would introduce a break, meaning there's no need for \\. – Werner Nov 6 '18 at 0:52

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.