von esdd » So 14. Jun 2015, 21:30
Du kannst auch eine cycle list verwenden. Dann musst Du nur die Marker und die Farben händisch in eine Liste eintragen. Das kannst Du entweder mit cycle list in den Optionen der axis Umgebung tun oder aber mit \pgfplotscreateplotcyclelist eine benannte Liste definieren, die Du dann über cycle list name in mehreren Plots verwenden kannst. In beiden Fällen musst Du \addplot+ verwenden. Dann "bedienen" sich die Plots der Reihe nach in der Liste.
\begin{filecontents*}{test.txt}
p x r er cr mr
1.4e-4 1.00 0.03 0.3 144 *
1.4e-4 10.00 0.07 0.4 144 *
1.4e-4 100.00 0.13 0.5 144 *
1.4e-4 1000.00 0.50 0.7 144 *
1.4e-5 1.00 0.01 0.8 145 +
1.4e-5 10.00 0.03 0.02 145 +
1.4e-5 100.00 0.08 0.05 145 +
1.4e-5 1000.00 0.20 0.4 145 +
\end{filecontents*}
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\definecolor{144}{rgb}{0.8,0.6,0}
\definecolor{145}{rgb}{0,0,0.5}
\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel = s,
ylabel = $\frac{U_\text{2}}{I_\text{4}}$,
ymin = 0.0001,
ymax = 1,
legend style={at={(1,0.95)},anchor=north west},
legend cell align=left,
grid = both,
cycle list={{mark=*,144},{mark=+,145}}
]
\pgfplotsinvokeforeach{1.4e-5, 1.4e-4}{
\addplot+[error bars/.cd,x dir=both,y dir=both,y explicit relative,]
table[x=x,y=r,restrict expr to domain={\thisrowno{0}}{#1:#1},y error=er,log basis x=10]
{test.txt};
\addlegendentry{#1\, V}
}
\end{loglogaxis}
\end{tikzpicture}
\end{document}
oder
\begin{filecontents*}{test.txt}
p x r er cr mr
1.4e-4 1.00 0.03 0.3 144 *
1.4e-4 10.00 0.07 0.4 144 *
1.4e-4 100.00 0.13 0.5 144 *
1.4e-4 1000.00 0.50 0.7 144 *
1.4e-5 1.00 0.01 0.8 145 +
1.4e-5 10.00 0.03 0.02 145 +
1.4e-5 100.00 0.08 0.05 145 +
1.4e-5 1000.00 0.20 0.4 145 +
\end{filecontents*}
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\definecolor{144}{rgb}{0.8,0.6,0}
\definecolor{145}{rgb}{0,0,0.5}
\pgfplotscreateplotcyclelist{mylist}{%
{mark=*,144},
{mark=+,145}%
}
\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel = s,
ylabel = $\frac{U_\text{2}}{I_\text{4}}$,
ymin = 0.0001,
ymax = 1,
legend style={at={(1,0.95)},anchor=north west},
legend cell align=left,
grid = both,
cycle list name=mylist
]
\pgfplotsinvokeforeach{1.4e-4, 1.4e-5}{
\addplot+[error bars/.cd,x dir=both,y dir=both,y explicit relative,]
table[x=x,y=r,restrict expr to domain={\thisrowno{0}}{#1:#1},y error=er,log basis x=10]
{test.txt};
\addlegendentry{#1\, V}
}
\end{loglogaxis}
\end{tikzpicture}
\end{document}
Gruß
Elke
Du kannst auch eine [tt]cycle list[/tt] verwenden. Dann musst Du nur die Marker und die Farben händisch in eine Liste eintragen. Das kannst Du entweder mit [tt]cycle list[/tt] in den Optionen der [tt]axis[/tt] Umgebung tun oder aber mit [tt]\pgfplotscreateplotcyclelist[/tt] eine benannte Liste definieren, die Du dann über [tt]cycle list name[/tt] in mehreren Plots verwenden kannst. In beiden Fällen musst Du [tt]\addplot+[/tt] verwenden. Dann "bedienen" sich die Plots der Reihe nach in der Liste.
[code]\begin{filecontents*}{test.txt}
p x r er cr mr
1.4e-4 1.00 0.03 0.3 144 *
1.4e-4 10.00 0.07 0.4 144 *
1.4e-4 100.00 0.13 0.5 144 *
1.4e-4 1000.00 0.50 0.7 144 *
1.4e-5 1.00 0.01 0.8 145 +
1.4e-5 10.00 0.03 0.02 145 +
1.4e-5 100.00 0.08 0.05 145 +
1.4e-5 1000.00 0.20 0.4 145 +
\end{filecontents*}
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\definecolor{144}{rgb}{0.8,0.6,0}
\definecolor{145}{rgb}{0,0,0.5}
\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel = s,
ylabel = $\frac{U_\text{2}}{I_\text{4}}$,
ymin = 0.0001,
ymax = 1,
legend style={at={(1,0.95)},anchor=north west},
legend cell align=left,
grid = both,
cycle list={{mark=*,144},{mark=+,145}}
]
\pgfplotsinvokeforeach{1.4e-5, 1.4e-4}{
\addplot+[error bars/.cd,x dir=both,y dir=both,y explicit relative,]
table[x=x,y=r,restrict expr to domain={\thisrowno{0}}{#1:#1},y error=er,log basis x=10]
{test.txt};
\addlegendentry{#1\, V}
}
\end{loglogaxis}
\end{tikzpicture}
\end{document}[/code]
oder
[code]\begin{filecontents*}{test.txt}
p x r er cr mr
1.4e-4 1.00 0.03 0.3 144 *
1.4e-4 10.00 0.07 0.4 144 *
1.4e-4 100.00 0.13 0.5 144 *
1.4e-4 1000.00 0.50 0.7 144 *
1.4e-5 1.00 0.01 0.8 145 +
1.4e-5 10.00 0.03 0.02 145 +
1.4e-5 100.00 0.08 0.05 145 +
1.4e-5 1000.00 0.20 0.4 145 +
\end{filecontents*}
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\definecolor{144}{rgb}{0.8,0.6,0}
\definecolor{145}{rgb}{0,0,0.5}
\pgfplotscreateplotcyclelist{mylist}{%
{mark=*,144},
{mark=+,145}%
}
\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel = s,
ylabel = $\frac{U_\text{2}}{I_\text{4}}$,
ymin = 0.0001,
ymax = 1,
legend style={at={(1,0.95)},anchor=north west},
legend cell align=left,
grid = both,
cycle list name=mylist
]
\pgfplotsinvokeforeach{1.4e-4, 1.4e-5}{
\addplot+[error bars/.cd,x dir=both,y dir=both,y explicit relative,]
table[x=x,y=r,restrict expr to domain={\thisrowno{0}}{#1:#1},y error=er,log basis x=10]
{test.txt};
\addlegendentry{#1\, V}
}
\end{loglogaxis}
\end{tikzpicture}
\end{document}[/code]
Gruß
Elke