von thor » Mi 25. Feb 2015, 15:13
Hallo liebes Forum,
ich habe hier folgendes kleines Diagramm, was ich darstellen möchte:
\documentclass[12pt]{scrreprt}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{filecontents}
\begin{document}
\begin{filecontents}{ABC.dat}
0.43,17
0.55,9
0.64,15
0.48,7
\end{filecontents}
\begin{tikzpicture}
\begin{axis}[%
style=thick,
minor tick num=1,
xlabel=\sffamily\footnotesize relativer Marktanteil in \%,
ylabel=\sffamily\footnotesize Marktwachstum in \%,
xmin=0,
xmax=1.2,
ymin=0,
ymax=22,
mark size=4pt,
legend pos=outer north east,
legend style={mark size=2pt},
% scatter
]
\addplot+[mark=*] coordinates {%
(0.43,17)%
};
\addplot+[mark=*] coordinates {%
(0.55,9)%
};
\addplot+[mark=*] coordinates {%
(0.64,15)%
};
\addplot+[mark=*] coordinates {%
(0.48,7)%
};
\legend{A,B,C,D};
\end{axis}
\end{tikzpicture}
\end{document}
Wie man sehen kann, entsprechen die einzelnen Datenpunkte jeweils *einem* xy-Wert aus ABC.dat.
ABC.dat ist dynamisch und wird aus einer Excel-Tabelle generiert.
Wie kann ich pgfplots nun dazubringen je \addplot nur den jeweiligen xy-Wert einer Reihe auszulesen, also Reihe 1: 0.43,17, etc.
Ein
\addplot table[x index=0,y index=2,col sep=comma] {ABC.dat};
würde ja alle xy-Werte von ABC-dat auslesen. Ich hoffe, Ihr versteht, was ich meine
Weiß jemand Rat?
Vielen Dank
Thorsten
Hallo liebes Forum,
ich habe hier folgendes kleines Diagramm, was ich darstellen möchte:
[code]
\documentclass[12pt]{scrreprt}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{filecontents}
\begin{document}
\begin{filecontents}{ABC.dat}
0.43,17
0.55,9
0.64,15
0.48,7
\end{filecontents}
\begin{tikzpicture}
\begin{axis}[%
style=thick,
minor tick num=1,
xlabel=\sffamily\footnotesize relativer Marktanteil in \%,
ylabel=\sffamily\footnotesize Marktwachstum in \%,
xmin=0,
xmax=1.2,
ymin=0,
ymax=22,
mark size=4pt,
legend pos=outer north east,
legend style={mark size=2pt},
% scatter
]
\addplot+[mark=*] coordinates {%
(0.43,17)%
};
\addplot+[mark=*] coordinates {%
(0.55,9)%
};
\addplot+[mark=*] coordinates {%
(0.64,15)%
};
\addplot+[mark=*] coordinates {%
(0.48,7)%
};
\legend{A,B,C,D};
\end{axis}
\end{tikzpicture}
\end{document}
[/code]
Wie man sehen kann, entsprechen die einzelnen Datenpunkte jeweils *einem* xy-Wert aus ABC.dat.
ABC.dat ist dynamisch und wird aus einer Excel-Tabelle generiert.
Wie kann ich pgfplots nun dazubringen je \addplot nur den jeweiligen xy-Wert einer Reihe auszulesen, also Reihe 1: 0.43,17, etc.
Ein
[code]
\addplot table[x index=0,y index=2,col sep=comma] {ABC.dat};
[/code]
würde ja alle xy-Werte von ABC-dat auslesen. Ich hoffe, Ihr versteht, was ich meine :-)
Weiß jemand Rat?
Vielen Dank
Thorsten[b] :D [/b]