|
Beiträge: 91344
Top-Poster: Johannes_B (4929)
Wir begrüßen unseren neuesten Benutzer zu22.
|
|
|
|
PGFplots in Kombination mit subcaption |
|
Udo |
Gast
|
 |
Beiträge: ---
|
 |
|
 |
Anmeldedatum: ---
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 13.03.2017, 12:55
Titel: PGFplots in Kombination mit subcaption
|
 |
|
 |
|
Hallo,
ich möchte mit dem Paket "subcaption" zwei pgfplots nebeneinander setzen.
Wenn ich das mache:
Code • Öffne in Overleaf |
\documentclass{article}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{subcaption}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{figure}[!htb]
\centering
\subcaptionbox{Bild1\label{bild1}}{%
\begin{tikzpicture}
\begin{axis}[enlargelimits=0.2]
\addplot+ [nodes near coords,only marks,point meta=explicit symbolic] table [meta=label] {
x y label
0.5 0.2 1
0.2 0.1 t2
0.7 0.6 3
0.35 0.4 Y4
0.65 0.1 5
};
\end{axis}
\end{tikzpicture}
}%
\subcaptionbox{Bild2\label{bild2}}{%
\begin{tikzpicture}
\begin{axis}[enlargelimits=0.2]
\addplot+ [nodes near coords,only marks,point meta=explicit symbolic] table [meta=label] {
x y label
0.5 0.2 1
0.2 0.1 t2
0.7 0.6 3
0.35 0.4 Y4
0.65 0.1 5
};
\end{axis}
\end{tikzpicture}
}%
\caption{TestCap}
\end{figure}
\end{document} |
kommt der Fehler:
Code • Öffne in Overleaf |
Package pgfplots Error: Could not read table file '" x y label 0 .5 0.2 1 0.2 0.1 t2 0.7 0.6 3 0.35 0.4 Y4 0.65 0.1 5 "' in 'search path=.'. In case you intended to provide inline data: maybe TeX screwed up your end-of-line s? Try `row sep=crcr' and terminate your lines with `\\' (refer to the pgfplots table manual for details). |
Das merkwürdige ist, dass die beiden pgfplots aus der Doku sind und ohne subcaption auch problemlos laufen. Kommentiert man also die zwei Zeilen mit subcaptionbox und der schließenden Klammer aus, funktioniert es:
Code • Öffne in Overleaf |
\documentclass{article}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{subcaption}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{figure}[!htb]
\centering
%\subcaptionbox{Bild1\label{bild1}}{%
\begin{tikzpicture}
\begin{axis}[enlargelimits=0.2]
\addplot+ [nodes near coords,only marks,point meta=explicit symbolic] table [meta=label] {
x y label
0.5 0.2 1
0.2 0.1 t2
0.7 0.6 3
0.35 0.4 Y4
0.65 0.1 5
};
\end{axis}
\end{tikzpicture}
%}%
%\subcaptionbox{Bild2\label{bild2}}{%
\begin{tikzpicture}
\begin{axis}[enlargelimits=0.2]
\addplot+ [nodes near coords,only marks,point meta=explicit symbolic] table [meta=label] {
x y label
0.5 0.2 1
0.2 0.1 t2
0.7 0.6 3
0.35 0.4 Y4
0.65 0.1 5
};
\end{axis}
\end{tikzpicture}
%}%
\caption{TestCap}
\end{figure}
\end{document} |
Weiß jemand, warum das so ist?
Gruß Udo
|
|
|
Udo |
Gast
|
 |
Beiträge: ---
|
 |
|
 |
Anmeldedatum: ---
|
 |
|
 |
Wohnort: ---
|
 |
|
 |
Version: ---
|
 |
|
|
 |
|
Verfasst am: 13.03.2017, 13:48
Titel:
|
 |
Hallo,
Danke, so funktioniert es zwar, aber ich habe mehrere tausend Messwerte und kann nicht überall händisch dieses \\ hinzufügen.
Ich habe jetzt subcaptionbox durch
ersetzt. Damit tritt komischerweise kein Fehler auf.
Verglichen zu subcaptionbox dürfte das ja kein Unterschied machen, oder?
Gruß Udo
|
|
|
|
|
Options and Permissions
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum nicht posten Du kannst Dateien in diesem Forum herunterladen
|
|
|