0

I am using the IEEEtran package and have three figures A,B,C which are propper figures (\begin{figure}...\end{figure}) containing pgfplots. I now want to display A,B,C next to each other spanning the page:

+-------+
| A B C |
|.......|
|.......|
|.......|
+-------+

I cannot remove the figure environment from either of the figures as they all need different captions and different labels

As a working example:

File test.tex

\documentclass[conference]{IEEEtran}
\pagestyle{plain}

\usepackage{multicol}
\usepackage{pgfplots}
\usepackage{tikz}


\begin{document}

\begin{figure*}[t]
\begin{minipage}{0.33\textwidth}
\centering
\input{fig-test}
\end{minipage}
\begin{minipage}{0.33\textwidth}
\centering
\input{fig-test}
\end{minipage}
\begin{minipage}{0.33\textwidth}
\centering
\input{fig-test}
\end{minipage}
\end{figure*}

\end{document}

File fig-test.tex

\begin{tikzpicture}
\begin{axis}[
xlabel={X},
ylabel={Y},
legend style={cells={align=right},at={(.5,0.975)}},
legend columns=1,
    ymin=0,
    ymax=1.1,
    legend columns=1,
    xmin=0.9,
    xmax=1,
]
\addplot[line width=1] table {./general-test.txt};
\legend{A,B,C,D,E}
\end{axis}
\end{tikzpicture}
%}
\caption{This is a caption.}
\label{fig:reduce-type}

File general-test.txt

Stable  number
0.242   0.1
0.900   0.1
0.905   0.1
0.910   0.1
0.915   0.1
0.920   0.1
0.925   0.1
0.930   0.1
Sim
  • 240
  • Set each of the figures' image-and-caption inside a minipage that is around 1/3 of the \textwidth and use only a single figure environment. – Werner Aug 14 '15 at 17:51
  • it is not a duplicate as I also need independent labels and this is not mentioned in the given duplicate. – Sim Aug 14 '15 at 17:53
  • Different captions and different labels... what do you mean by labels? – Werner Aug 14 '15 at 17:54
  • \label{fig:this-is-used-by-ref} – Sim Aug 14 '15 at 17:55
  • Did you think of trying the floatrow package? – Bernard Aug 14 '15 at 17:59
  • @Werner it furthermore does not appear to work as the pgfplots are not shrinked down to fit the page. They are now overlapping – Sim Aug 14 '15 at 17:59
  • That doesn't make a difference. Place the appropriate \label after each \caption inside the respective minipages. See this paste. – Werner Aug 14 '15 at 17:59
  • 1
    @Sim: Since your problem seems to be escalating into something we can't easily replicate, I suggest that you provide the community with a minimal working example (MWE) that replicates your current problem. From there one can address your issues more readily. – Werner Aug 14 '15 at 18:01
  • @Werner I added the example. – Sim Aug 14 '15 at 18:15
  • @Sim: I would also reword your problem to not emphasize the fact that you want multiple figures in the same environment. That problem has been dealt with and is clearly answered in the link I gave. Your problem has turned into one of seeking a way to reduce the width of a pgfplot to fit within a given horizontal boundary. – Werner Aug 14 '15 at 18:31
  • Can you suggest a title. I was actually quite lost for words when I was both searching for an answer and formulating the question. I assumed having figures floating in another figure environment could solve my problem. Thus resulting in the title. – Sim Aug 14 '15 at 19:02

0 Answers0