Seite 1 von 1

PGF und sidecaption mit \fcapside und floatrow

Verfasst: Di 19. Nov 2013, 09:53
von elmar.a
Guten Morgen,

ich verzweifle gerade daran, eine Figure caption neben einem PGF Plot darzustellen. Der Plot selber funktioniert ohne Probleme und in anderen Floats funktioniert auch mein Code, hier will er aber einfach nicht. Weiss jemand Rat??

Hier ein Minimalbeispiel:
\documentclass[11pt,twoside]{scrartcl}

\usepackage{multicol}
\usepackage{floatrow}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{ternary}
\usetikzlibrary{pgfplots.ternary}

\begin{document}
\begin{multicols}{2}

% funktioniert:
\begin{figure*}
	\centering
			\begin{tikzpicture}[font=\sffamily]
				\begin{ternaryaxis}[
						width=.5\textwidth,
						xmin=0,xmax=1,
						xtick=\empty,
						ytick=\empty,
						ztick=\empty,
						major tick length=0pt,
						grid=none,
						]
				\addplot table {
						0.5 0.5 0
						0.5 0 0.5
						};
				\addplot table {
						0.5 0.25 0.25
						0.45 0.275 0.275
						};
			\end{ternaryaxis}
		\end{tikzpicture}
	\caption{Caption}
	\label{label}
\end{figure*}

% funktioniert nicht:
\begin{figure*}
	\centering
	\fcapside[\FBwidth]
			{\begin{tikzpicture}[font=\sffamily]
				\begin{ternaryaxis}[
						width=.5\textwidth,
						xmin=0,xmax=1,
						xtick=\empty,
						ytick=\empty,
						ztick=\empty,
						major tick length=0pt,
						grid=none,
						]
				\addplot table {
						0.5 0.5 0
						0.5 0 0.5
						};
				\addplot table {
						0.5 0.25 0.25
						0.45 0.275 0.275
						};
			\end{ternaryaxis}
		\end{tikzpicture}}
	{\caption{Caption}
	\label{label}}
\end{figure*}

\end{multicols}
\end{document}
Als Fehlermeldung bekomme ich Folgendes:
"! Package pgfplots Error: Could not read table file '" Wo En Fs 0.5 0.5 0 0.5 0 0.5 "'. In case you intended to provide inline data: maybe TeX screwed up your end-of-lines? Try `row sep=crcr' and terminate your lines with `\\' (refer to the pgfplotstable manual for details)."
Das habe ich natuerlich versucht, leider erfolglos.

Weiss jemand woran es sonst noch liegen koennte?

Vielen Dank im Voraus und beste Gruesse,
elmar.a

Verfasst: Di 19. Nov 2013, 10:02
von Johannes_B
Das hat doch mit der caption erst mal nichts zu tun. Die von pgfplots vorgeschlagene Lösung ist auch recht eindeutig, finde ich.
\documentclass[11pt,twoside]{scrartcl}

\usepackage{multicol}
\usepackage{floatrow}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{ternary}
\usetikzlibrary{pgfplots.ternary}

\begin{document}
\begin{multicols}{2}

% funktioniert:
\begin{figure*}
   \centering
         \begin{tikzpicture}[font=\sffamily]
            \begin{ternaryaxis}[
                  width=.5\textwidth,
                  xmin=0,xmax=1,
                  xtick=\empty,
                  ytick=\empty,
                  ztick=\empty,
                  major tick length=0pt,
                  grid=none,
                  ]
		  \addplot table [row sep=crcr] {
                  0.5 0.5 0\\
                  0.5 0 0.5\\
                  };
		  \addplot table [row sep=crcr] {
                  0.5 0.25 0.25\\
                  0.45 0.275 0.275\\
                  };
         \end{ternaryaxis}
      \end{tikzpicture}
   \caption{Caption}
   \label{label}
\end{figure*}

% funktioniert nicht:
\begin{figure*}
   \centering
   \fcapside[\FBwidth]
         {\begin{tikzpicture}[font=\sffamily]
            \begin{ternaryaxis}[
                  width=.5\textwidth,
                  xmin=0,xmax=1,
                  xtick=\empty,
                  ytick=\empty,
                  ztick=\empty,
                  major tick length=0pt,
                  grid=none,
                  ]
		  \addplot table [row sep=crcr] {
                  0.5 0.5 0\\
                  0.5 0 0.5\\
                  };
		  \addplot table [row sep=crcr] {
                  0.5 0.25 0.25\\
                  0.45 0.275 0.275\\
                  };
         \end{ternaryaxis}
      \end{tikzpicture}}
   {\caption{Caption}
   \label{label}}
\end{figure*}

\end{multicols}
\end{document}
 

Verfasst: Di 19. Nov 2013, 10:30
von elmar.a
Johannes_B hat geschrieben:Das hat doch mit der caption erst mal nichts zu tun. Die von pgfplots vorgeschlagene Lösung ist auch recht eindeutig, finde ich.
Strange, jetzt funktioniert es! Dabei hatte ich (einige Male!!!) genau das versucht!!

Danke an Dich, Johannes_B!


Dennoch: Wie kommt's, dass in meinem Minimalbeispiel der erste Plot tadellos ausgefuehrt wird, der zweite jedoch nicht? Die beiden sind doch identisch (bis auf die \fcapside-Geschichte)......