PGF und sidecaption mit \fcapside und floatrow

Tabellen und Grafiken erstellen und anordnen


elmar.a
Forum-Anfänger
Forum-Anfänger
Beiträge: 28
Registriert: Mo 25. Jun 2012, 18:36

PGF und sidecaption mit \fcapside und floatrow

Beitrag 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

Benutzeravatar
Johannes_B
Moderator
Moderator
Beiträge: 5079
Registriert: Do 1. Nov 2012, 14:55
Kontaktdaten:

Beitrag 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}
 
TeXwelt - Fragen und Antworten Schaut vorbei und stellt Fragen.
LaTeX-Vorlagen?

Der Weg zum Ziel: Ruhe bewahren und durchatmen, Beiträge und unterstützende Links aufmerksam lesen, Lösungsansätze verstehen und ggf. nachfragen.

elmar.a
Forum-Anfänger
Forum-Anfänger
Beiträge: 28
Registriert: Mo 25. Jun 2012, 18:36

Beitrag 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)......

Antworten