Wenn ich wie im Beispiel drei Kurven mit pgfplots 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 ?

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\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 )
};
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

gefragt 05 Jun '17, 18:43

butts's gravatar image

butts
689183440
Akzeptiert-Rate: 40%

bearbeitet 07 Feb '18, 08:01

saputello's gravatar image

saputello
11.1k174365


Wenn du die Farbe der Marker setzen möchtest musst du mark options verwenden (hat nichts mit visible on zu tun).

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\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->,
mark options={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 )
};
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

alt text

Wenn auch die Legende aufgedeckt werden darf statt immer vollständig zu sein, könnte man auch Beamer-Overlays und die pgfplots-Legende verwenden.

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\documentclass[10pt]{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{frame}{Siedetemperaturen im Vergleich}
\begin{tikzpicture}
\begin{axis}[
xlabel=Anzahl C-Atome,
ylabel=Siedetemperatur in $^{\circ}$C,
xmajorgrids=true,
grid style=dashed,
legend columns=3,
legend pos=south east,
only marks,
]
\only<1->{
\addplot+[mark=*,mark options={color = orange!70, fill = orange!70}]
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 )
};
\addlegendentry{Alkane}
}
\only<2->{
\addplot+[mark=*,mark options={color = blue!60, fill = blue!60}]
coordinates {
(1, 65)
(2, 78)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

alt text

Permanenter link

beantwortet 05 Jun '17, 23:28

Henri's gravatar image

Henri
15.7k133943
Akzeptiert-Rate: 46%

bearbeitet 05 Jun '17, 23:39

DANKE ! gute Antwort auch dass die Legende mit den Kurven aufgedeckt wird.

(06 Jun '17, 21:33) butts
Deine Antwort
[Vorschau ausblenden]

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Frage-Themen:

×298
×141

gestellte Frage: 05 Jun '17, 18:43

Frage wurde gesehen: 7,941 Mal

zuletzt geändert: 06 Jun '17, 21:33