Seite 1 von 1

pgfplots: Es wird nur ein Teil der Daten geplottet

Verfasst: So 15. Sep 2013, 20:52
von monchi
Hi,

ich habe mir für meine Ba-Thesis ein Diagramm zusammen gebaut. Damit ich nicht jedesmal die gesamte Thesis kompilieren muss habe ich das in einem Extradokument getan.
\documentclass{scrartcl}
\usepackage{pgfplots,pgfplotstable}

\definecolor{colScClass1}{rgb}{1,0,0}
\definecolor{colScClass2}{rgb}{0,1,0}
\definecolor{colScClass3}{rgb}{0,0,1}
\definecolor{colScClass4}{rgb}{0,0,0}
\def\varSingleGraphScale{1.2}

\pgfkeys{/pgf/number format/set thousands separator={}}

\begin{document}
	
	\begin{tikzpicture}[scale=\varSingleGraphScale]
			\def\varXmax{60}
			\def\varYmax{100}

			\pgfplotstableread[col sep=comma]{content/diagData/ergTGV03-120-30bar-halbiert.txt}\loadedtable
				
			\begin{axis}[
						ylabel={$Partikeldurchmesser\ [\mu m]$},
						xlabel={$Zeit\ [s]$},
						xmin={0},
						ymin={0},
						xmax={\varXmax},
						ymax={\varYmax},
						minor tick num=1,
						try min ticks=5,
						extra x ticks={15,40},
						extra x tick style={grid=major,
						tick label style={
							rotate=0,anchor=south east}},
						extra x tick labels={1),2)}
					]
					\addplot[colScClass1, no marks] table [x={Time (relative)},y={Dx(90)},col sep=comma] {\loadedtable};
					\addplot[colScClass2, no marks] table [x={Time (relative)},y={Dx(50)},col sep=comma] {\loadedtable};
					\addplot[colScClass3, no marks] table [x={Time (relative)},y={Dx(10)},col sep=comma] {\loadedtable};
					\legend{$x_{90}$,$x_{50}$,$x_{10}$}
		\end{axis}
	\end{tikzpicture}	
	
\end{document}
Wenn ich jetzt den gesamten Code ohne Änderungen in mein Hauptdokument kopiere werden die Daten nur im Intervall von ca. 7 bis 45 geplottet.

Hat jemand eine Idee woran das liegen könnte?

Hier die Rohdaten für das Diagramm:
Date-Time,Time (relative),Dx(90),Dx(50),Dx(10)
22 Jul 2013 14:21:19,1.0000,63.08,32.04,12.42
22 Jul 2013 14:21:20,2.0000,64.95,34.21,14.17
22 Jul 2013 14:21:21,3.0000,62.59,34.49,16.23
22 Jul 2013 14:21:22,4.0000,65.00,35.95,16.73
22 Jul 2013 14:21:23,5.0000,63.42,34.39,15.17
22 Jul 2013 14:21:24,6.0000,64.24,35.48,16.15
22 Jul 2013 14:21:25,7.0000,62.94,34.13,16.05
22 Jul 2013 14:21:26,8.0000,59.27,31.99,15.60
22 Jul 2013 14:21:27,9.0000,61.11,33.07,15.71
22 Jul 2013 14:21:28,10.0000,63.77,33.82,14.90
22 Jul 2013 14:21:29,11.0000,61.36,33.13,15.04
22 Jul 2013 14:21:30,12.0000,61.34,33.35,15.67
22 Jul 2013 14:21:31,13.0000,60.20,32.88,16.17
22 Jul 2013 14:21:32,14.0000,62.20,34.69,17.50
22 Jul 2013 14:21:33,15.0000,62.02,35.39,18.56
22 Jul 2013 14:21:34,16.0000,62.23,35.22,18.28
22 Jul 2013 14:21:35,17.0000,63.36,35.06,17.31
22 Jul 2013 14:21:36,18.0000,61.86,35.08,18.01
22 Jul 2013 14:21:37,19.0000,63.00,35.83,18.11
22 Jul 2013 14:21:38,20.0000,62.68,34.67,16.54
22 Jul 2013 14:21:39,21.0000,61.19,34.62,17.58
22 Jul 2013 14:21:40,22.0000,60.10,33.65,16.91
22 Jul 2013 14:21:41,23.0000,61.94,33.40,15.60
22 Jul 2013 14:21:42,24.0000,63.23,33.84,15.46
22 Jul 2013 14:21:43,25.0000,62.16,33.64,15.38
22 Jul 2013 14:21:44,26.0000,62.11,33.76,15.25
22 Jul 2013 14:21:45,27.0000,61.45,33.73,15.85
22 Jul 2013 14:21:46,28.0000,61.07,33.77,16.18
22 Jul 2013 14:21:47,29.0000,60.92,33.28,15.57
22 Jul 2013 14:21:48,30.0000,62.67,34.41,16.09
22 Jul 2013 14:21:49,31.0000,60.33,33.13,15.81
22 Jul 2013 14:21:50,32.0000,63.17,34.16,16.10
22 Jul 2013 14:21:51,33.0000,60.38,33.44,16.70
22 Jul 2013 14:21:52,34.0000,60.23,32.90,16.01
22 Jul 2013 14:21:53,35.0000,60.25,32.75,15.92
22 Jul 2013 14:21:54,36.0000,61.58,33.85,15.79
22 Jul 2013 14:21:55,37.0000,62.38,33.65,15.39
22 Jul 2013 14:21:56,38.0000,61.17,33.17,15.85
22 Jul 2013 14:21:57,39.0000,63.51,34.65,15.06
22 Jul 2013 14:21:58,40.0000,62.35,34.06,15.50
22 Jul 2013 14:21:59,41.0000,63.11,33.79,15.08
22 Jul 2013 14:22:00,42.0000,60.45,31.89,14.76
22 Jul 2013 14:22:01,43.0000,62.80,33.50,14.91
22 Jul 2013 14:22:02,44.0000,64.21,32.82,12.96
22 Jul 2013 14:22:03,45.0000,63.10,32.71,13.54
22 Jul 2013 14:22:04,46.0000,60.33,32.07,14.77
22 Jul 2013 14:22:05,47.0000,61.42,32.88,14.85
22 Jul 2013 14:22:06,48.0000,65.47,33.91,13.67
22 Jul 2013 14:22:07,49.0000,61.35,32.28,14.57
22 Jul 2013 14:22:08,50.0000,63.09,34.41,14.94
22 Jul 2013 14:22:09,51.0000,62.85,34.57,15.63
22 Jul 2013 14:22:10,52.0000,64.30,33.14,12.87
22 Jul 2013 14:22:11,53.0000,64.86,33.58,12.16
22 Jul 2013 14:22:12,54.0000,67.82,36.25,14.49
22 Jul 2013 14:22:13,55.0000,64.65,36.08,16.62
22 Jul 2013 14:22:14,56.0000,67.08,35.86,14.67
22 Jul 2013 14:22:14,60.0000,67.08,35.86,14.67
22 Jul 2013 14:22:14,65.0000,67.08,35.86,14.67

Verfasst: So 15. Sep 2013, 21:55
von esdd
Wenn ich dich richtig verstehe, dann liefert der Code, so wie er da steht, bei dir genauso wie bei mir einen Plot zwischen 0 und 60. Damit dir jemand helfen kann, wird aber ein Minimalbeispiel benötigt, bei dem das Problem auch auftritt.

Du kannst das Diagramm allerdings aber auch separat erstellen und dann in dein Hauptdokument einbinden. Wenn du für das Diagramm die Dokumentenklasse standalone verwendest, wird der weiße Rand weggeschnitten.

Gruß
Elke

Verfasst: Mo 16. Sep 2013, 08:09
von Johannes_B
Du kannst auch die Diagramme "externalisieren", dafür gibt es eine Bibliothek mit Namen externalize. Mehr Informationen dazu findest du im entsprechenden Abschnitt in der Dokumentation von TikZ/pgf.

Letztlich macht es aber auch nur das von Elke erwähnte, es packt für dich das Diagramm in eine Standalone-Dokument und lädt in folgenden Läufen die erzeugte pdf.

Physikalische Einheiten werden übrigens aufrecht gesetzt. Wenn du dich nicht um sowas kümmern willst, aber trotzdem willst das alles korrekt aussieht, dann schau dir bitte das Paket siunitx an.

Grüße
Johannes

Verfasst: Di 17. Sep 2013, 18:41
von monchi
hm ggf. muss ich diesen Umweg dann gehen. Irgendwas in meiner Praeamble zerschießt mir das Diagramm.


zu den EInheiten: Vorschlag wurde übernommen ;-)