Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 3
kleiner Tippfehler in pgfplot

07 Feb '18, 08:01

saputello's gravatar image

saputello
11.1k174365

Wie umgeht man das Problem in der Farbdarstellung von pgfplot pgfplots bei visible ?

Wenn ich wie im Beispiel drei Kurven mit pgfplot `pgfplots` darstelle und mit verschiedenen Farben markiere dann stimmen die Farben im plot Plot und in der Legende nicht überein, wenn ich die drei plots Plots nacheinander sichtbar mache mit visible. `visible`. Gibt es dafür eine Lösung ? \documentclass[10pt]{beamer} \usepackage{pgfplots} \tikzset{ invisible/.style={opacity=0}, visible on/.style={alt={#1{}{invisible}}}, alt/.code args={<#1>#2#3}{% \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path }, } \begin{document} \frame{\frametitle{Siedetemperaturen im Vergleich} \begin{tikzpicture} \begin{axis}[ xlabel=Anzahl C-Atome, ylabel=Siedetemperatur in $^{\circ}$C, xmajorgrids=true, grid style=dashed, legend style={at={(0.02,0.9)},anchor=west,}, ] \addplot+[visible on=<1->, color = orange!70, fill = orange!70, mark = *, only marks ] coordinates { ( 1, -161.7 ) ( 2, -88.6 ) ( 3, -42.2 ) ( 4, -0.5 ) ( 5, 36.1 ) ( 6, 68.7 ) ( 7, 98.4 ) ( 8, 125.6 ) ( 9, 150.7 ) ( 10, 174.0 ) }; \addplot+[visible on=<2->, color = blue!60, fill = blue!60, mark = *, only marks ] coordinates { (1, 65) (2, 78) (3, 97) (4, 117) (5, 138) (6, 157) (7, 176) (8, 195) (9, 215) (10, 228) }; \addplot+[visible on=<3->, color = olive!70, fill = olive!70, mark = *, only marks ] coordinates { (1, -19) (2, 20) (3, 49) (4, 75) (5, 102) (6, 131) (7, 153) (8, 171) (9, 191) (10, 209) }; \node [draw,fill=white,anchor=north east] at (rel axis cs: 0.99,0.14) {Alkane \textcolor{orange!70}{$\bullet$} $\,$ Alkanale \textcolor{olive!70}{$\bullet$}$\,$ Alkohole \textcolor{blue!60}{$\bullet$}}; \end{axis} \end{tikzpicture} } \end{document}
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

05 Jun '17, 18:46

butts's gravatar image

butts
689183440

Wie umgeht man das Problem in der Farbdarstellung von pgfplot bei visible ?

Wenn ich wie im Beispiel drei Kurven mit pgfplot darstelle und mit verschiedenen Farben markiere dann stimmen die Farben im plot und in der Legende nicht überein, wenn ich die drei plots nacheinander sichtbar mache mit visible. Gibt es dafür eine Lösung ? \documentclass[10pt]{beamer} \usepackage{pgfplots} \tikzset{ invisible/.style={opacity=0}, visible on/.style={alt={#1{}{invisible}}}, alt/.code args={<#1>#2#3}{% \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path }, } \begin{document} \frame{\frametitle{Siedetemperaturen im Vergleich} \begin{tikzpicture} \begin{axis}[ xlabel=Anzahl C-Atome, ylabel=Siedetemperatur in $^{\circ}$C, xmajorgrids=true, grid style=dashed, legend style={at={(0.02,0.9)},anchor=west,}, ] \addplot+[visible on=<1->, color = orange!70, fill = orange!70, mark = *, only marks ] coordinates { ( 1, -161.7 ) ( 2, -88.6 ) ( 3, -42.2 ) ( 4, -0.5 ) ( 5, 36.1 ) ( 6, 68.7 ) ( 7, 98.4 ) ( 8, 125.6 ) ( 9, 150.7 ) ( 10, 174.0 ) }; \addplot+[visible on=<2->, color = blue!60, fill = blue!60, mark = *, only marks ] coordinates { (1, 65) (2, 78) (3, 97) (4, 117) (5, 138) (6, 157) (7, 176) (8, 195) (9, 215) (10, 228) }; \addplot+[visible on=<3->, color = olive!70, fill = olive!70, mark = *, only marks ] coordinates { (1, -19) (2, 20) (3, 49) (4, 75) (5, 102) (6, 131) (7, 153) (8, 171) (9, 191) (10, 209) }; \node [draw,fill=white,anchor=north east] at (rel axis cs: 0.99,0.14) {Alkane \textcolor{orange!70}{$\bullet$} $\,$ Alkanale \textcolor{olive!70}{$\bullet$}$\,$ Alkohole \textcolor{blue!60}{$\bullet$}}; \end{axis} \end{tikzpicture} } \end{document}
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

05 Jun '17, 18:43

butts's gravatar image

butts
689183440