1

I am trying to place a single caption underneath four figures. I can place a caption underneath each figure, but that is not what I want. I am using the floatrow package.

\documentclass{article}
\usepackage{pgfplots}
\usepackage{floatrow}
\usepackage{caption}

\def\mygraphcaption{Here are my graphs.}
\begin{figure}[h]
\begin{floatrow}[4]

\ffigbox{
\begin{tikzpicture}
\begin{axis}[axis lines=middle,width=5.3cm,
  xmin=-2.8,xmax=2.8,ymin=-2.5,ymax=3.5,
  xlabel=$x$,   
  ylabel={$y$},
  xtick distance=1,
  ytick distance=1,
  xticklabel style={font=\tiny},
  yticklabel style={font=\tiny},
  title style={yshift=0ex,xshift=-15ex},
  x label style={yshift=-3ex,xshift=2ex,font=\tiny},
  y label style={yshift=2ex,xshift=-3ex,font=\tiny},]

\end{axis}
\end{tikzpicture}
}

\ffigbox{
\begin{tikzpicture}
\begin{axis}[axis lines=middle,width=5.3cm,
  xmin=-2.8,xmax=2.8,ymin=-2.5,ymax=3.5,
  xlabel=$x$,   
  ylabel={$y$},
  xtick distance=1,
  ytick distance=1,
  xticklabel style={font=\tiny},
  yticklabel style={font=\tiny},
  title style={yshift=0ex,xshift=-15ex},
  x label style={yshift=-3ex,xshift=2ex,font=\tiny},
  y label style={yshift=2ex,xshift=-3ex,font=\tiny},]



\end{axis}
\end{tikzpicture}
}


\ffigbox{
\begin{tikzpicture}
\begin{axis}[axis lines=middle,width=5.3cm,
  xmin=-2.8,xmax=2.8,ymin=-2.5,ymax=3.5,
  xlabel=$x$,   
  ylabel={$y$},
  xtick distance=1,
  ytick distance=1,
  xticklabel style={font=\tiny},
  yticklabel style={font=\tiny},
  title style={yshift=0ex,xshift=-15ex},
  x label style={yshift=-3ex,xshift=2ex,font=\tiny},
  y label style={yshift=2ex,xshift=-3ex,font=\tiny},]



\end{axis}
\end{tikzpicture}
}


\ffigbox{
\begin{tikzpicture}
\begin{axis}[axis lines=middle,width=5.3cm,
  xmin=-2.8,xmax=2.8,ymin=-2.5,ymax=3.5,
  xlabel=$x$,   
  ylabel={$y$},
  xtick distance=1,
  ytick distance=1,
  xticklabel style={font=\tiny},
  yticklabel style={font=\tiny},
  title style={yshift=0ex,xshift=-15ex},
  x label style={yshift=-3ex,xshift=2ex,font=\tiny},
  y label style={yshift=2ex,xshift=-3ex,font=\tiny},]

\end{axis}
\end{tikzpicture}
\caption{\mygraphcaption}
}

\end{floatrow}

\end{figure}

enter image description here

2

Using the subfloatrow environment as described in section '6.1 Managing of Float Parts With the subfloatrow Environment' of the floatrow manual one can achieve the following result. Please be aware that the caption appears to be not horizontally centered as the 4 graphs are much wieder than the textwidth of the standard article.

enter image description here

\documentclass{article}
\usepackage{pgfplots}
\usepackage{floatrow}
\usepackage{caption}

\def\mygraphcaption{Here are my graphs.}
\begin{document}

\begin{figure}[h]
\ffigbox{
\begin{subfloatrow}[4]

%\ffigbox{
\begin{tikzpicture}
\begin{axis}[axis lines=middle,width=5.3cm,
  xmin=-2.8,xmax=2.8,ymin=-2.5,ymax=3.5,
  xlabel=$x$,   
  ylabel={$y$},
  xtick distance=1,
  ytick distance=1,
  xticklabel style={font=\tiny},
  yticklabel style={font=\tiny},
  title style={yshift=0ex,xshift=-15ex},
  x label style={yshift=-3ex,xshift=2ex,font=\tiny},
  y label style={yshift=2ex,xshift=-3ex,font=\tiny},]

\end{axis}
\end{tikzpicture}
%}

%\ffigbox{
\begin{tikzpicture}
\begin{axis}[axis lines=middle,width=5.3cm,
  xmin=-2.8,xmax=2.8,ymin=-2.5,ymax=3.5,
  xlabel=$x$,   
  ylabel={$y$},
  xtick distance=1,
  ytick distance=1,
  xticklabel style={font=\tiny},
  yticklabel style={font=\tiny},
  title style={yshift=0ex,xshift=-15ex},
  x label style={yshift=-3ex,xshift=2ex,font=\tiny},
  y label style={yshift=2ex,xshift=-3ex,font=\tiny},]



\end{axis}
\end{tikzpicture}
%}


%\ffigbox{
\begin{tikzpicture}
\begin{axis}[axis lines=middle,width=5.3cm,
  xmin=-2.8,xmax=2.8,ymin=-2.5,ymax=3.5,
  xlabel=$x$,   
  ylabel={$y$},
  xtick distance=1,
  ytick distance=1,
  xticklabel style={font=\tiny},
  yticklabel style={font=\tiny},
  title style={yshift=0ex,xshift=-15ex},
  x label style={yshift=-3ex,xshift=2ex,font=\tiny},
  y label style={yshift=2ex,xshift=-3ex,font=\tiny},]



\end{axis}
\end{tikzpicture}
%}


%\ffigbox{
\begin{tikzpicture}
\begin{axis}[axis lines=middle,width=5.3cm,
  xmin=-2.8,xmax=2.8,ymin=-2.5,ymax=3.5,
  xlabel=$x$,   
  ylabel={$y$},
  xtick distance=1,
  ytick distance=1,
  xticklabel style={font=\tiny},
  yticklabel style={font=\tiny},
  title style={yshift=0ex,xshift=-15ex},
  x label style={yshift=-3ex,xshift=2ex,font=\tiny},
  y label style={yshift=2ex,xshift=-3ex,font=\tiny},]

\end{axis}
\end{tikzpicture}

%}

\end{subfloatrow}
}{\caption{\mygraphcaption}}
\end{figure}

\end{document}

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.