pgfplots x-Achsenbeschriftung "skaliert"
Verfasst: Mo 12. Mai 2014, 13:37
Hallo liebe Forumgemeinde,
ich erstelle sämtliche Datenplots für ein Projekt mit pgfplots. Dazu sieht mein Skript folgendermaßen aus:
Das Datenfile dazu sieht so aus:
Nun sieht der Plot auch recht ansehlich aus, allerdings sind im Datenfile Messwerte für insgesamt 1200 Stunden vorhanden. - Eine Achsenbeschriftung in Stundenschritten macht hier wenig Sinn.
Wie ist es möglich, dass ich pgfplots dazu bringe, die x-Achse so zu plotten, dass diese in Tagesschritten beschriftet werden? Also, dass dann gilt: "0 = 0; 24 h = 1; 48 h = 2; 72 h = 3 ...".
Mit gnuplot ging es recht einfach "benutzerdefinierte xticks" zu setzen ... in pgfplots habe ich hier leider noch nicht viel dazu gefunden bzw. weiß auch nicht wirklich wie ich danach suchen soll.
Ich wäre über eine Hilfe dankbar!
Danke im Voraus und liebe Grüße,
netorha
ich erstelle sämtliche Datenplots für ein Projekt mit pgfplots. Dazu sieht mein Skript folgendermaßen aus:
\documentclass[tikz,border=1pt]{standalone} \usepackage[ngerman]{babel} \usepackage[ansinew]{inputenc} \usepackage[T1]{fontenc} \usepackage{graphicx} \usepackage{pgfplots} \usepackage{amsmath} \pgfplotsset{compat=1.10, 03_emod/.style={ %title=Knotentemperaturen, legend style={ legend pos=north west, draw=none }, xmin=0, xmax=180, xlabel={Zeit $t$ [h]}, x tick style={ color=black, thin }, ymin=0, ymax=35000, ylabel={Elastizitätsmodul [MPa]}, y tick style={ color=black, thin }, scaled y ticks = false, height=9cm, width=15cm, grid=major, grid style={ solid, ultra thin, gray }, /pgf/number format/.cd, use comma, set thousands separator={}, } } \begin{document} \begin{tikzpicture} \begin{axis}[03_emod] %\draw[black, thin] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0); \addplot[blue, thick, solid] table [x index=0,y index=3, skip first n=1] {02_adiabatisch.dat}; \addlegendentry{Modell} \end{axis} \end{tikzpicture} \end{document}
Zeit 37teff 37hy 37emod_wes 37fctm_wes 0 0.000 0.000 0.000 0.000 1 0.953 0.000 716.645 0.001 2 1.879 0.000 2436.649 0.016 3 2.783 0.000 4123.567 0.046 4 3.676 0.000 5618.490 0.085 5 4.566 0.001 6934.014 0.130 6 5.467 0.006 8109.279 0.177 7 6.392 0.015 9179.639 0.227 8 7.356 0.031 10171.247 0.279 9 8.369 0.052 11101.556 0.332 10 9.440 0.079 11981.385 0.387 11 10.575 0.110 12816.954 0.443 12 11.777 0.143 13611.568 0.499 13 13.047 0.178 14366.885 0.556 14 14.384 0.213 15083.806 0.613 15 15.786 0.247 15763.042 0.670 16 17.249 0.281 16405.428 0.725 17 18.770 0.313 17012.051 0.780 18 20.345 0.343 17584.274 0.833 19 21.971 0.371 18123.689 0.885 20 23.642 0.398 18632.049 0.936 21 25.357 0.422 19111.192 0.985 22 27.111 0.445 19562.986 1.032 23 28.902 0.466 19989.268 1.077 24 30.728 0.486 20391.814 1.121 25 32.585 0.504 20772.316 1.163 26 34.473 0.520 21132.363 1.204 27 36.389 0.536 21473.439 1.243 28 38.331 0.550 21796.917 1.281 29 40.299 0.564 22104.067 1.317 30 42.290 0.576 22396.056 1.352 31 44.304 0.588 22673.955 1.386 (...)
Wie ist es möglich, dass ich pgfplots dazu bringe, die x-Achse so zu plotten, dass diese in Tagesschritten beschriftet werden? Also, dass dann gilt: "0 = 0; 24 h = 1; 48 h = 2; 72 h = 3 ...".
Mit gnuplot ging es recht einfach "benutzerdefinierte xticks" zu setzen ... in pgfplots habe ich hier leider noch nicht viel dazu gefunden bzw. weiß auch nicht wirklich wie ich danach suchen soll.
Ich wäre über eine Hilfe dankbar!
Danke im Voraus und liebe Grüße,
netorha