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

28 Aug '18, 10:49

cis's gravatar image

cis
9.6k103460491

pgfplots: Änderung des Defaults für den Startpunkt des \coordindex zu 1, statt 0

Im Handbuch heißt es \coordindex Yields the current index of the table row (starting with 0). This does not count header or comment lines. Will man den Startpunkt bei 1 haben, bedient man sich, je nach Anwendung, des Tricks, `\coordindex+1`. Ich habe mich gefragt, ob man auch global die Zählung bei 1 Starten starten lassen kann. Willkürliches MWE: \documentclass[margin=5mm, tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{patchplots} \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot+[only marks, nodes near coords=\coordindex, ] table[row sep=\\] { 0 2 \\%0 2 2 \\%1 0 1 \\%2 0 0 \\%3 1 0 \\%4 2 0 \\%5 2 0 \\%6 1 1 \\%7 }; \end{axis} \end{tikzpicture} \end{document}
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

28 Aug '18, 10:49

cis's gravatar image

cis
9.6k103460491

pgfplots: Änderung des Defaults für den Startpunkt des \coordindex zu 1, statt 0

Im Handbuch heißt es \coordindex Yields the current index of the table row (starting with 0). This does not count header or comment comment lines. Will man den Startpunkt bei 1 haben, bedient man sich, je nach Anwendung Anwendung, des Tricks, `\coordindex+1`. Ich habe mich gefragt, ob man auch global die Zählung bei 1 Starten lassen kann. Willkürliches MWE: \documentclass[margin=5mm, tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{patchplots} \begin{document} \begin{tikzpicture} \begin{axis}[] \addplot+[only marks, nodes near coords=\coordindex, ] table[row sep=\\] { 0 2 \\%0 2 2 \\%1 0 1 \\%2 0 0 \\%3 1 0 \\%4 2 0 \\%5 2 0 \\%6 1 1 \\%7 }; \end{axis} \end{tikzpicture} \end{document}
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

28 Aug '18, 10:48

cis's gravatar image

cis
9.6k103460491