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

11 Sep '18, 19:07

cis's gravatar image

cis
9.6k104461491

Mit der Lösung von @Murmeltier im Thread `https://texwelt.de/wissen/fragen/22832/pgfplots-punkte-eines-plots-benennen-und-in-einem-anderen-plot-verwenden` konnte ich folgendes MWE erstellen. (Da das aber als zu umständlich gilt, gebe ich seienr seiner Lösung den Vorzug.) [![alt text][1]][1] \documentclass[margin=5mm, tikz]{standalone} \usetikzlibrary{angles} %\usetikzlibrary{quotes, babel} \usepackage{pgfplots} \usepgfplotslibrary{patchplots} \pgfplotsset{compat=1.13} % Für die Winkel \pgfdeclarelayer{bg} % declare background layer \pgfsetlayers{bg,main} % set the order of the layers (main is the standard \begin{document} \begin{tikzpicture} \begin{axis}[hide axis, colormap={Kantenfarbe}{color=(gray) color=(gray)}, %width=7cm, height=3cm, ] % Zeichnung der Punkte ===================== \addplot+[ mark size=1.125pt, mark options={red}, table/row sep=\\, patch, % Plot-Typ patch type=polygon, vertex count=2, % damit nur Kanten, keine Flächen, gezeichnet werden % % Angabe der Verbindungskanten ===================== patch table with point meta={% Startpkt Endpkt colordata \\%colordata weglassen 1 2 \\% 1 1 \\% 1 2 \\% 2 3 \\% 3 4 \\% } ] table[header=true, x index=1, y index=2, row sep=\\] { Nr x y \\ 0 0 0 \\%0: 0. Aliaspunkt 1 1 3 \\%1 2 0 2 \\%2 3 2 2 \\%3 4 2 1 \\%4 }; % Beschriftungen ============================ % Anzeigen des 0. Aliaspunktes verhindern: \newcommand\Punktnummer{\pgfmathparse{\punktnummer>0 ? \punktnummer : ""}\pgfmathresult} \addplot[only marks, visualization depends on={value \thisrowno{0} \as \punktnummer}, nodes near coords={\Punktnummer}, % nodes near coords style={ name=p-\punktnummer, %alias=p-\punktnummer, path picture={% Jedem Punkt als Koordinate zuordnen: \coordinate[] (P\punktnummer) at (p-\coordindex.south); },% %inner sep=0pt, outer sep=0pt }, ] table[header=true, x index=1, y index=2, row sep=\\] { Nr x y \\ 0 0 0 \\%0: 0. Aliaspunkt 1 1 3 \\%1 2 0 2 \\%2 3 2 2 \\%3 4 2 1 \\%4 }; % Zeichnung der Winkel ===================== \addplot[no marks, nodes near coords={}, %visualization depends on={value \thisrowno{0} \as \punktnummer}, visualization depends on={value \thisrowno{0} \as \PunktI}, visualization depends on={value \thisrowno{1} \as \Scheitel}, visualization depends on={value \thisrowno{2} \as \PunktII}, visualization depends on={value \thisrowno{3} \as \Winkelradius}, visualization depends on={value \thisrowno{4} \as \Winkelfarbe}, nodes near coords style={% %minimum size=2\textwidth, % 12cm %<- nicht nötig %overlay, %<- nicht nötig path picture={%\pgftransformreset % Winkel zeichnen \begin{pgfonlayer}{bg} % 'select the background layer' für die Winkel \draw pic [angle radius=\Winkelradius, fill=\Winkelfarbe!50, draw=\Winkelfarbe, %<- Winkel färben / zeichnen %-latex, %<- Winkel mit Pfeil %"aaa", angle eccentricity =-3.0 %<- besser weglassen... ] {angle = P\PunktI--P\Scheitel--P\PunktII}; \end{pgfonlayer} }},% ] table[header=true, x expr =0, y expr=0]{ Punkt1 Scheitel Punkt2 Winkelradius Winkelfarbe 3 2 1 1.2cm red 2 3 4 0.6cm blue }; \end{axis} % Test %\draw[red] (P1) -- (P3); % %\draw pic [draw,-,red,angle radius=1cm,fill=red!50] {angle = P3--P2--P1}; % %\draw pic [draw,-,red,angle radius=1cm,fill=red!50] {angle = P2--P3--P4}; \end{tikzpicture} \documentclass[margin=5mm, tikz]{standalone} \usetikzlibrary{angles} %\usetikzlibrary{quotes, babel} \usepackage{pgfplots} \usepgfplotslibrary{patchplots} \pgfplotsset{compat=1.13} % Für die Winkel \pgfdeclarelayer{bg} % declare background layer \pgfsetlayers{bg,main} % set the order of the layers (main is the standard \begin{document} \begin{tikzpicture} \begin{axis}[hide axis, colormap={Kantenfarbe}{color=(gray) color=(gray)}, %width=7cm, height=3cm, ] % Zeichnung der Punkte ===================== \addplot+[ mark size=1.125pt, mark options={red}, table/row sep=\\, patch, % Plot-Typ patch type=polygon, vertex count=2, % damit nur Kanten, keine Flächen, gezeichnet werden % % Angabe der Verbindungskanten ===================== patch table with point meta={% Startpkt Endpkt colordata \\%colordata weglassen 1 2 \\% 1 1 \\% 1 2 \\% 2 3 \\% 3 4 \\% } ] table[header=true, x index=1, y index=2, row sep=\\] { Nr x y \\ 0 0 0 \\%0: 0. Aliaspunkt 1 1 3 \\%1 2 0 2 \\%2 3 2 2 \\%3 4 2 1 \\%4 }; % Beschriftungen ============================ % Anzeigen des 0. Aliaspunktes verhindern: \newcommand\Punktnummer{\pgfmathparse{\punktnummer>0 ? \punktnummer : ""}\pgfmathresult} \addplot[only marks, visualization depends on={value \thisrowno{0} \as \punktnummer}, nodes near coords={\Punktnummer}, % nodes near coords style={ name=p-\punktnummer, %alias=p-\punktnummer, path picture={% Jedem Punkt als Koordinate zuordnen: \coordinate[] (P\punktnummer) at (p-\coordindex.south); },% %inner sep=0pt, outer sep=0pt }, ] table[header=true, x index=1, y index=2, row sep=\\] { Nr x y \\ 0 0 0 \\%0: 0. Aliaspunkt 1 1 3 \\%1 2 0 2 \\%2 3 2 2 \\%3 4 2 1 \\%4 }; % Zeichnung der Winkel ===================== \addplot[no marks, nodes near coords={}, %visualization depends on={value \thisrowno{0} \as \punktnummer}, visualization depends on={value \thisrowno{0} \as \PunktI}, visualization depends on={value \thisrowno{1} \as \Scheitel}, visualization depends on={value \thisrowno{2} \as \PunktII}, visualization depends on={value \thisrowno{3} \as \Winkelradius}, visualization depends on={value \thisrowno{4} \as \Winkelfarbe}, nodes near coords style={% %minimum size=2\textwidth, % 12cm %<- nicht nötig %overlay, %<- nicht nötig path picture={%\pgftransformreset % Winkel zeichnen \begin{pgfonlayer}{bg} % 'select the background layer' für die Winkel \draw pic [angle radius=\Winkelradius, fill=\Winkelfarbe!50, draw=\Winkelfarbe, %<- Winkel färben / zeichnen %-latex, %<- Winkel mit Pfeil %"aaa", angle eccentricity =-3.0 %<- besser weglassen... ] {angle = P\PunktI--P\Scheitel--P\PunktII}; \end{pgfonlayer} }},% ] table[header=true, x expr =0, y expr=0]{ Punkt1 Scheitel Punkt2 Winkelradius Winkelfarbe 3 2 1 1.2cm red 2 3 4 0.6cm blue }; \end{axis} % Test %\draw[red] (P1) -- (P3); % %\draw pic [draw,-,red,angle radius=1cm,fill=red!50] {angle = P3--P2--P1}; % %\draw pic [draw,-,red,angle radius=1cm,fill=red!50] {angle = P2--P3--P4}; \end{tikzpicture} \end{document} [1]: https://texwelt.de/wissen/upfiles/55555555_202.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 5

11 Sep '18, 19:07

cis's gravatar image

cis
9.6k104461491

Mit der Lösung von @Murmeltier im Thread `https://texwelt.de/wissen/fragen/22832/pgfplots-punkte-eines-plots-benennen-und-in-einem-anderen-plot-verwenden` konnte ich folgendes MWE erstellen. (Da das aber als zu umständlich bzw. zu individualisiert problematisch gilt, gebe ich seienr Lösung den Vorzug.) [![alt text][1]][1] \documentclass[margin=5mm, tikz]{standalone} \usetikzlibrary{angles} %\usetikzlibrary{quotes, babel} \usepackage{pgfplots} \usepgfplotslibrary{patchplots} \pgfplotsset{compat=1.13} % Für die Winkel \pgfdeclarelayer{bg} % declare background layer \pgfsetlayers{bg,main} % set the order of the layers (main is the standard \begin{document} \begin{tikzpicture} \begin{axis}[hide axis, colormap={Kantenfarbe}{color=(gray) color=(gray)}, width=7cm, height=7cm, %width=7cm, height=3cm, ] % Zeichnung der Punkte ===================== \addplot+[ mark size=1.125pt, mark options={red}, table/row sep=\\, patch, % Plot-Typ patch type=polygon, vertex count=2, % damit nur Kanten, keine Flächen, gezeichnet werden % % Angabe der Verbindungskanten ===================== patch table with point meta={% Startpkt Endpkt colordata \\%colordata weglassen 1 2 \\% 1 1 \\% 1 2 \\% 2 3 \\ \\% 3 4 \\ \\% } % Tabelle der Punkte ===================== ] table[header=true, x index=1, y index=2, row sep=\\] { Nr x y \\ 0 0 0 \\%0: 0. Aliaspunkt 1 1 3 \\%1 2 0 2 \\%2 3 2 2 \\%3 4 2 1 \\%4 }; % Beschriftungen ============================ % Anzeigen des 0. Aliaspunktes verhindern: \newcommand\Punktnummer{\pgfmathparse{\punktnummer>0 ? \punktnummer : ""}\pgfmathresult} \addplot[only marks, visualization depends on={value \thisrowno{0} \as \punktnummer}, nodes near coords={\punktnummer}, coords={\Punktnummer}, % nodes near coords style={ name=p-\punktnummer, %alias=p-\punktnummer, path picture={% Jedem Punkt als Koordinate zuordnen: \coordinate[] (P\punktnummer) at (p-\coordindex.south); },% %inner sep=0pt, outer sep=0pt }, ] table[header=true, x index=1, y index=2, row sep=\\] { Nr x y \\ 0 0 0 \\%0: 0. Aliaspunkt 1 1 3 \\%1 2 0 2 \\%2 3 2 2 \\%3 4 2 1 \\%4 }; % Zeichnung der Winkel ===================== \addplot[no marks, marks, nodes near coords={}, visualization %visualization depends on={value \thisrowno{0} \as \punktnummer}, visualization depends on={value \thisrowno{0} \as \PunktI}, visualization depends on={value \thisrowno{1} \as \Scheitel}, visualization depends on={value \thisrowno{2} \as \PunktII}, visualization depends on={value \thisrowno{3} \as \Winkelradius}, visualization depends on={value \thisrowno{4} \as \Winkelfarbe}, %visualization depends on={value \thisrowno{5} \as \Winkelbeschriftung}, nodes near coords style={% minimum size=\textwidth, %minimum size=2\textwidth, % 12cm %<- großer Wert nicht nötig overlay, %overlay, %<- verhindert WhiteSpace nicht nötig path picture={%\pgftransformreset % Winkel zeichnen \begin{pgfonlayer}{bg} % 'select the background layer' für die Winkel \draw pic [angle radius=\Winkelradius, fill=\Winkelfarbe!50, draw=\Winkelfarbe, %<- Winkel färben / zeichnen -latex, %-latex, %<- Winkel mit Pfeil %"aaa", angle eccentricity =-3.0 %<- besser weglassen... ] {angle = P\PunktI--P\Scheitel--P\PunktII}; \end{pgfonlayer} }},% ] table[header=true, x expr =0, y expr=0]{ Punkt1 Scheitel Punkt2 Winkelradius Farbe Winkelfarbe 3 2 1 1.2cm red 2 3 4 0.6cm blue }; \end{axis} %\path foreach \X in {1,2,3,4} {(c-\X) coordinate (X\X)}; %\draw pic [draw,-latex,red,angle radius=1cm,fill=blue!50] {angle = X3--X2--X1}; %\draw pic [draw,-latex,red,angle radius=1cm,fill=red!50] {angle = c-3--c-2--c-1}; % Test %\draw[red] (P1) -- (P3); % %\draw pic [draw,-,red,angle radius=1cm,fill=red!50] {angle = P3--P2--P1}; % %\draw pic [draw,-,red,angle radius=1cm,fill=red!50] {angle = P2--P3--P4}; \end{tikzpicture} \documentclass[margin=5mm, tikz]{standalone} \usetikzlibrary{angles} %\usetikzlibrary{quotes, babel} \usepackage{pgfplots} \usepgfplotslibrary{patchplots} \pgfplotsset{compat=1.13} % Für die Winkel \pgfdeclarelayer{bg} % declare background layer \pgfsetlayers{bg,main} % set the order of the layers (main is the standard \begin{document} \begin{tikzpicture} \begin{axis}[hide axis, colormap={Kantenfarbe}{color=(gray) color=(gray)}, %width=7cm, height=3cm, ] % Zeichnung der Punkte ===================== \addplot+[ mark size=1.125pt, mark options={red}, table/row sep=\\, patch, % Plot-Typ patch type=polygon, vertex count=2, % damit nur Kanten, keine Flächen, gezeichnet werden % % Angabe der Verbindungskanten ===================== patch table with point meta={% Startpkt Endpkt colordata \\%colordata weglassen 1 2 \\% 1 1 \\% 1 2 \\% 2 3 \\% 3 4 \\% } ] table[header=true, x index=1, y index=2, row sep=\\] { Nr x y \\ 0 0 0 \\%0: 0. Aliaspunkt 1 1 3 \\%1 2 0 2 \\%2 3 2 2 \\%3 4 2 1 \\%4 }; % Beschriftungen ============================ % Anzeigen des 0. Aliaspunktes verhindern: \newcommand\Punktnummer{\pgfmathparse{\punktnummer>0 ? \punktnummer : ""}\pgfmathresult} \addplot[only marks, visualization depends on={value \thisrowno{0} \as \punktnummer}, nodes near coords={\Punktnummer}, % nodes near coords style={ name=p-\punktnummer, %alias=p-\punktnummer, path picture={% Jedem Punkt als Koordinate zuordnen: \coordinate[] (P\punktnummer) at (p-\coordindex.south); },% %inner sep=0pt, outer sep=0pt }, ] table[header=true, x index=1, y index=2, row sep=\\] { Nr x y \\ 0 0 0 \\%0: 0. Aliaspunkt 1 1 3 \\%1 2 0 2 \\%2 3 2 2 \\%3 4 2 1 \\%4 }; % Zeichnung der Winkel ===================== \addplot[no marks, nodes near coords={}, %visualization depends on={value \thisrowno{0} \as \punktnummer}, visualization depends on={value \thisrowno{0} \as \PunktI}, visualization depends on={value \thisrowno{1} \as \Scheitel}, visualization depends on={value \thisrowno{2} \as \PunktII}, visualization depends on={value \thisrowno{3} \as \Winkelradius}, visualization depends on={value \thisrowno{4} \as \Winkelfarbe}, nodes near coords style={% %minimum size=2\textwidth, % 12cm %<- nicht nötig %overlay, %<- nicht nötig path picture={%\pgftransformreset % Winkel zeichnen \begin{pgfonlayer}{bg} % 'select the background layer' für die Winkel \draw pic [angle radius=\Winkelradius, fill=\Winkelfarbe!50, draw=\Winkelfarbe, %<- Winkel färben / zeichnen %-latex, %<- Winkel mit Pfeil %"aaa", angle eccentricity =-3.0 %<- besser weglassen... ] {angle = P\PunktI--P\Scheitel--P\PunktII}; \end{pgfonlayer} }},% ] table[header=true, x expr =0, y expr=0]{ Punkt1 Scheitel Punkt2 Winkelradius Winkelfarbe 3 2 1 1.2cm red 2 3 4 0.6cm blue }; \end{axis} % Test %\draw[red] (P1) -- (P3); % %\draw pic [draw,-,red,angle radius=1cm,fill=red!50] {angle = P3--P2--P1}; % %\draw pic [draw,-,red,angle radius=1cm,fill=red!50] {angle = P2--P3--P4}; \end{tikzpicture} \end{document} [1]: https://texwelt.de/wissen/upfiles/55555555_202.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 4

10 Sep '18, 22:27

cis's gravatar image

cis
9.6k104461491

Klicke auf Einblenden/Ausblenden von Überarbeitungen 3

10 Sep '18, 21:26

cis's gravatar image

cis
9.6k104461491

Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

10 Sep '18, 21:25

cis's gravatar image

cis
9.6k104461491

Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

10 Sep '18, 21:24

cis's gravatar image

cis
9.6k104461491