Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 3
Formatanpassungen

08 Apr '15, 18:22

dzaic's gravatar image

dzaic
631175055

Wie kann ich meine Datumsachse bei pgfplots formatieren?

Eigentlich habe ich zwei Fragen: 1) Wie bekomme ich es hin, dass meine Datumswerte auf der x-Achse tageweise angezeigt werden und zwischen den Tagen jeweils 4 Liniens Hilfslinien (entspricht 6 h) angezeigt werden? 2) Warum werden die gelbe und graue Linie plötzlich gestrichelt dargestellt? \documentclass{standalone} \usepackage{luatextra} \usepackage{fontspec} \setmainfont{Arial} \setsansfont{Arial} \setmonofont{Consolas} \defaultfontfeatures{Ligatures=TeX} \usepackage{tikz, pgfplots} \usepgfplotslibrary{dateplot} \usetikzlibrary{shapes,arrows, patterns} \begin{document} \newcommand\MyLineWith{5pt} \begin{tikzpicture} \begin{axis}[ %axis background/.style = {shade,top color=gray!50,bottom color=gray!50}, axis on top = true, width = \textwidth, height = 5cm, enlargelimits=false, ymin=0, ymax=5, yticklabels={,,}, date coordinates in = x, date ZERO = 2015-08-01 00:00, xmin = 2015-08-09 00:00, xmax = 2015-09-06 00:00, xticklabel style = {anchor=east, rotate=90, font=\tiny} ] % CRD \addplot+[const plot, line width=\MyLineWith, color=red, mark=] coordinates { (2015-08-11 06:00, 1.0) (2015-09-01 05:00, 1.0)}; % SEHR \addplot+[const plot, line width=\MyLineWith, color=blue, mark=] coordinates { (2015-08-12 00:00, 1.5) (2015-09-02 12:00, 1.5)}; % Div. 21 \addplot+[const plot, line width=\MyLineWith, color=green, mark=] coordinates { (2015-08-13 03:00, 2.0) (2015-08-23 07:00, 2.0)}; % Div. 11 \addplot+[const plot, line width=\MyLineWith, color=orange, mark=] coordinates { (2015-09-04 22:00, 2.5) (2015-08-23 07:00, 2.5)}; % HPCS \addplot+[const plot, line width=\MyLineWith, color=black, mark=] coordinates { (2015-08-13 03:00, 3.0) (2015-09-01 08:00, 3.0)}; % 380 kV AC20 \addplot+[const plot, line width=\MyLineWith, color=yellow, mark=] coordinates { (2015-08-13 10:00, 3.5) (2015-08-24 15:00, 3.5)}; % 380 kV AC60 \addplot+[const plot, line width=\MyLineWith, color=gray, mark=] coordinates { (2015-08-13 10:00, 4.0) (2015-08-20 15:00, 4.0)}; \end{axis} \end{tikzpicture} \end{document} ![Bild][1] [1]: http://texwelt.de/wissen/upfiles/Bild_8.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2
Formatierungsanpassungen

08 Apr '15, 18:21

dzaic's gravatar image

dzaic
631175055

Wie kann ich meine Datumsachse bei pgfplots formatieren?

Eigentlich habe ich zwei Fragen: 1) Wie bekomme ich es hin, dass meine Datumswerte auf der x-Achse tageweise angezeigt werden und zwischen den Tagen jeweils 4 Liniens (entspricht 6 h) angezeigt werden? 2) Warum werden die gelbe und graue Linie plötzlich gestrichelt dargestellt? \documentclass{standalone} \usepackage{luatextra} \usepackage{fontspec} \setmainfont{Arial} \setsansfont{Arial} \setmonofont{Consolas} \defaultfontfeatures{Ligatures=TeX} \usepackage{tikz, pgfplots} \usepgfplotslibrary{dateplot} \usetikzlibrary{shapes,arrows, patterns} \begin{document} \newcommand\MyLineWith{5pt} \begin{tikzpicture} \begin{axis}[ %axis background/.style = {shade,top color=gray!50,bottom color=gray!50}, axis on top = true, width = \textwidth, height = 5cm, enlargelimits=false, ymin=0, ymax=5, yticklabels={,,}, date coordinates in = x, date ZERO = 2015-08-01 00:00, xmin = 2015-08-09 00:00, xmax = 2015-09-06 00:00, xticklabel style = {anchor=east, rotate=90, font=\tiny} ] % CRD \addplot+[const plot, line width=\MyLineWith, color=red, mark=] coordinates { (2015-08-11 06:00, 1.0) (2015-09-01 05:00, 1.0)}; % SEHR \addplot+[const plot, line width=\MyLineWith, color=blue, mark=] coordinates { (2015-08-12 00:00, 1.5) (2015-09-02 12:00, 1.5)}; % Div. 21 \addplot+[const plot, line width=\MyLineWith, color=green, mark=] coordinates { (2015-08-13 03:00, 2.0) (2015-08-23 07:00, 2.0)}; % Div. 11 \addplot+[const plot, line width=\MyLineWith, color=orange, mark=] coordinates { (2015-09-04 22:00, 2.5) (2015-08-23 07:00, 2.5)}; % HPCS \addplot+[const plot, line width=\MyLineWith, color=black, mark=] coordinates { (2015-08-13 03:00, 3.0) (2015-09-01 08:00, 3.0)}; % 380 kV AC20 \addplot+[const plot, line width=\MyLineWith, color=yellow, mark=] coordinates { (2015-08-13 10:00, 3.5) (2015-08-24 15:00, 3.5)}; % 380 kV AC60 \addplot+[const plot, line width=\MyLineWith, color=gray, mark=] coordinates { (2015-08-13 10:00, 4.0) (2015-08-20 15:00, 4.0)}; \end{axis} \end{tikzpicture} \end{document} ![Bild][1] [1]: http://texwelt.de/wissen/upfiles/Bild_8.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

08 Apr '15, 18:21

dzaic's gravatar image

dzaic
631175055