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

26 Aug '18, 20:02

cis's gravatar image

cis
9.6k103460491

Es geht, in dem indem man `name=Name-\coordindex` oder `name=#1-\coordindex` verwendet. Ein mögliches Beispiel: \documentclass[margin=5mm, tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.13, name nodes near coords/.style={ every node near coord/.append style={ name=#1-\coordindex, % alias=#1-last, anchor=center, inner sep=0pt, outer sep=0.5pt, }, }, name nodes near coords/.default=coordnode } \begin{document} \begin{tikzpicture}[ BeschriftungsStyle/.style={text=black, font=\scriptsize\ttfamily, % \tiny % \scriptsize } ] \begin{axis}[hide axis, x = 15mm, y=15mm, nodes near coords, ] % Linienzug \addplot+ [name nodes near coords=P, nodes near coords={}, % Leere node setzen only marks, mark options={red}, mark size=1.125pt, ] table[header=false, x index=2, y index=3] {% P1 1 0.00 3.60 P2 2 1.00 3.60 P3 3 0.50 4.47 P4 4 -0.50 4.47 P5 5 -1.00 3.60 P6 6 -0.50 2.73 P7 7 0.50 2.73 P8 8 0.00 1.08 P9 9 -0.23 2.05 P10 10 0.73 1.76 }; \end{axis} % Beschriftung der Streichholzköpfe \foreach[evaluate={\N=int(\n+1)}] \n in {0,...,9} \node[above, BeschriftungsStyle] at (P-\n) {\N}; % Zeichnen der Linienzüge \foreach \n in {3,2,5,2,6,4,1} \draw[] (P-0) -- (P-\n); \foreach \n in {6,8,4} \draw[blue] (P-5) -- (P-\n); \end{tikzpicture} \end{document}
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

26 Aug '18, 20:01

cis's gravatar image

cis
9.6k103460491

Es geht, in dem man `name=Name-\coordindex` oder `name=#1-\coordindex` verwendet. Ein mögliches Beispiel: \documentclass[margin=5mm, tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.13, name nodes near coords/.style={ every node near coord/.append style={ name=#1-\coordindex, % alias=#1-last, anchor=center, inner sep=0pt, outer sep=0.5pt, }, }, name nodes near coords/.default=coordnode } \begin{document} \begin{tikzpicture}[ BeschriftungsStyle/.style={text=black, font=\scriptsize\ttfamily, % \tiny % \scriptsize } ] \begin{axis}[hide axis, x = 15mm, y=15mm, nodes near coords, ] % Linienzug \addplot+ [name nodes near coords=P, nodes near coords={}, % Leere node setzen only marks, mark options={red}, mark size=1.125pt, ] table[header=false, x index=2, y index=3] {% P1 1 0.00 3.60 P2 2 1.00 3.60 P3 3 0.50 4.47 P4 4 -0.50 4.47 P5 5 -1.00 3.60 P6 6 -0.50 2.73 P7 7 0.50 2.73 P8 8 0.00 1.08 P9 9 -0.23 2.05 P10 10 0.73 1.76 }; \end{axis} % Beschriftung der Streichholzköpfe \foreach[evaluate={\N=int(\n+1)}] \n in {0,...,9} \node[above, BeschriftungsStyle] at (P-\n) {\N}; % Zeichnen der Linienzüge \foreach \n in {3,2,5,2,6,4,1} \draw[] (P-0) -- (P-\n); \foreach \n in {6,8,4} \draw[blue] (P-5) -- (P-\n); \end{tikzpicture} \end{document}