Consider this code
\documentclass{article}
\pagestyle{empty}
\usepackage{pgfplots,subfigure}
\usepackage[justification=centering]{caption}
\usepackage{floatrow}
\begin{document}
\begin{figure}
\floatbox[{\capbeside
\captionsetup[capbesidefigure]{labelsep=newline,justification=RaggedRight,labelfont=bf}
\thisfloatsetup{capbesideposition={right,center},capbesidewidth=4cm}}]{figure}
[\FBwidth]
{\caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua}\label{fig:label}}
\centering
\subfigure{
\begin{tikzpicture}[remember picture]
\begin{axis}[
axis lines=left,
xmin=0,
xmax=7.5,
xtick={1,...,8},
ymin=0,
ymax=105,
thick,
grid=both,
width=0.6\textwidth
]
\addplot[smooth,thick] plot coordinates {
(0,35)
(1,60)
(2,20)
(3,95)
(4,45)
(5,30)
(6,60)
(7,55)
};
\end{axis}
\end{tikzpicture}
}
\subfigure{
\begin{tikzpicture}[remember picture]
\begin{axis}[
axis lines=left,
xmin=0,
xmax=7.5,
xtick={1,...,8},
ymin=0,
ymax=105,
thick,
grid=both,
width=0.6\textwidth
]
\addplot[smooth,thick] plot coordinates {
(0,45)
(1,55)
(2,40)
(3,70)
(4,55)
(5,35)
(6,50)
(7,45)
};
\end{axis}
\end{tikzpicture}
}
\subfigure{
\begin{tikzpicture}[remember picture]
\begin{axis}[
axis lines=left,
xmin=0,
xmax=7.5,
xtick={1,...,8},
ymin=0,
ymax=105,
thick,
grid=both,
width=0.6\textwidth
]
\addplot[smooth,thick] plot coordinates {
(0,45)
(1,55)
(2,40)
(3,60)
(4,55)
(5,35)
(6,50)
(7,45)
};
\end{axis}
\end{tikzpicture}
}
\end{figure}
\end{document}
What I get from above code is
How can I modify the code so that the caption would be at the (right) side of the figure? Note: the code works perfectly in single figure.
subfigure
is deprecated for a long, long time and should be replaced bysubcaption
orsubfig
.