2

I want to build a figure with 5 subfigures inside. The code I have goes as follows:

\begin{figure}[hbt]
\begin{subfigure}{0.4\textwidth}
\includegraphics[scale=0.25]{mi1}
\footnotesize{\caption{masa=$(0,0203 \pm 0,0001)\;kg$, $m=(2,43\pm 0,01)\; s^{-2}$, $b= (1,22 \pm 0,08)\; s^{-1}$, $R^2=0,990$. }}
\end{subfigure}
\begin{subfigure}{0.4\textwidth}
\includegraphics[scale=0.25]{mi2}
\footnotesize{\caption{masa=$(0,0401 \pm 0,0001)\;kg$, $m=(5,20\pm 0,03)\; s^{-2}$, $b= (3,6 \pm0,1)\; s^{-1}$, $R^2=0,990$.}}
\end{subfigure}
\begin{subfigure}{0.4\textwidth}
\includegraphics[scale=0.25]{mi3}
\footnotesize{\caption{masa=$(0,0503 \pm 0,0001)\;kg$, $m=(6,44\pm0,04)\; s^{-2}$, $b= (8,7 \pm0,1)\; s^{-1}$, $R^2=0,987$.}}
\end{subfigure}
\begin{subfigure}{0.4\textwidth}
\includegraphics[scale=0.25]{mi4}
\footnotesize{\caption{masa=$(0,0704 \pm 0,0001)\;kg$, $m=(9,32\pm0,05)\; s^{-2}$, $b= (11,9 \pm0,1)\; s^{-1}$, $R^2=0,987$.}}
\end{subfigure}
\begin{subfigure}{\textwidth}
\centering
\includegraphics[scale=0.25]{mi5}
\footnotesize{\caption{masa=$(0,0904 \pm 0,0001)\;kg$, \\ $m=(12,14\pm0,08)\; s^{-2}$, $b= (8,8 \pm \\ 0,2)\; s^{-1}$, $R^2=0,987$.}}
\end{subfigure}
\caption{Se representan las velocidades angulares que adquiere la placa cebra en función del tiempo cuando el sistema se encuentra acelerado angularmente por una masa variable que ejerce un torque a una distancia de $(0,01998 \pm 0,00001) \;m$  con respecto al centro de masa. En rojo se superpone la recta de regresión calculada por el método de cuadrados mínimos con su pendiente $m$.}
\end{figure}

The problem is with the last subfigure. I want to put it in the middle but if I use \linewidth, the caption of the subfigure begins at the beginning of the page and not where the subfigure actually is. This image shows the problem I'm facing.

Could someone help out with this one?

1 Answer 1

3

Instead of setting the width of the last subfigure to \textwidth, set that as well to 0.4\textwidth, add \centering at the start of the figure, and perhaps an \hfill between the subfigures that are on the same line.

Some other comments:

  • \footnotesize is not a macro that takes an argument, so to limit its effect you should use {\footnotsize ...\par}, not \footnotesize{..}. However, you shouldn't be using it for every subcaption the way you have, to change the font properties of subcaptions use \captionsetup, as in the code below.

  • Units should be written in upright font, not in the default math font, so $m$ for example is wrong. A very nice package for typesetting numbers with units (or just numbers, or just units) is siunitx. I modified your captions to use this below.

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subcaption}
\captionsetup[subfigure]{font=footnotesize,justification=raggedright}
\usepackage{siunitx}
\sisetup{
  output-decimal-marker={,},
  separate-uncertainty=true
}
\begin{document}

\begin{figure}[hbt]
\centering
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{%
$\text{masa}=\SI{0,0203 \pm 0,0001}{\kg}$, $m=\SI{2,43\pm 0,01}{\per\square\s}$, $b= \SI{1,22 \pm 0,08}{\per\s}$, $R^2=\num{0,990}$. }
\end{subfigure}\hfill
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{$\text{masa}=\SI{0,0401 \pm 0,0001}{\kg}$, $m=\SI{5,20\pm 0,03}{\per\square\s}$, $b= \SI{3,6 \pm0,1}{\per\s}$, $R^2=\num{0,990}$.}
\end{subfigure}

\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{$\text{masa}=\SI{0,0503 \pm 0,0001}{\kg}$, $m=\SI{6,44\pm0,04}{\per\second\squared}$, $b= \SI{8,7 \pm0,1}{\per\s}$, $R^2=\num{0,987}$.}
\end{subfigure}\hfill
\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{$\text{masa}=\SI{0,0704 \pm 0,0001}{\kg}$, $m=\SI{9,32\pm0,05}{\per\square\s}$, $b= \SI{11,9 \pm0,1}{\per\s}$, $R^2=\num{0,987}$.}
\end{subfigure}

\begin{subfigure}{0.45\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{$\text{masa}=\SI{0,0904 \pm 0,0001}{\kg}$,  $m=\SI{12,14\pm0,08}{\per\square\s}$, $b= \SI{8,8 \pm 0,2}{\per\s}$, $R^2=\num{0,987}$.}
\end{subfigure}
\caption{Se representan las velocidades angulares que adquiere la placa cebra en función del tiempo cuando el sistema se encuentra acelerado angularmente por una masa variable que ejerce un torque a una distancia de \SI{0,01998 \pm 0,00001}{\m}  con respecto al centro de masa. En rojo se superpone la recta de regresión calculada por el método de cuadrados mínimos con su pendiente \si{m}.}
\end{figure}
\end{document}

enter image description here

3
  • @JuanManuelPerezBertoldi I just edited my answer a bit. Commented May 26, 2016 at 17:47
  • In the caption of the figure as a whole, why is there a space between the two nines in 0,01998 \pm 0,00001 when using the \SI command? Is that the format convention for academic writing? Commented May 26, 2016 at 18:24
  • @JuanManuelPerezBertoldi Probably depends on whose conventions you're looking at. Sorry, didn't notice that. By default, siunitx will group numbers with five digits or more into groups of three, with a small space between, you can turn that off by adding group-digits=false to the \sisetup. Commented May 26, 2016 at 18:34

You must log in to answer this question.

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