von cis » Mi 5. Aug 2020, 12:08
Übermalen gefällt mir meistens nicht so sehr, ich würde es hier mit shorten machen:
- 5555555.png (7.18 KiB) 1306 mal betrachtet
\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex}}
\node[vertex] (M) at (-10,0) {M};
\node[vertex] (N) at (-6,0) {N};
\node[vertex] (PN) at (0,11) {PN};
\node[vertex] (Q) at (0,6) {Q};
\path[edge,name path=L1] (N) -- (PN);
\path[name path=L2] (M) |- (Q);
% Alt
%\fill [name intersections={of=L1 and L2,by=I},fill=red] (I) circle (.5cm);
% Neu
\path[name intersections={of=L1 and L2,by=I},label=I];
\draw[red, shorten >=4mm] (N) -- (I);
\draw[red, shorten <=4mm] (I) -- (PN);
\draw[edge] (M) |- (Q);
\path (N) -- (I) node[pos=.5,above,sloped] {Kartoffel};
\path (M) |- (I) node[pos=.75,above] {Handball};
\end{tikzpicture}
\end{document}
PS: shorten kann mitunter auch problematisch sein, man kann auch echte Koordinaten vor und nach dem Schnittpunkt platzieren:
- 5555555.png (7.08 KiB) 1300 mal betrachtet
\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex}}
\node[vertex] (M) at (-10,0) {M};
\node[vertex] (N) at (-6,0) {N};
\node[vertex] (PN) at (0,11) {PN};
\node[vertex] (Q) at (0,6) {Q};
\path[edge,name path=L1] (N) -- (PN);
\path[name path=L2] (M) |- (Q);
% Alt
%\fill [name intersections={of=L1 and L2,by=I},fill=red] (I) circle (.5cm);
% Neu 2
\path[name intersections={of=L1 and L2,by=I},label=I];
\path[] (N) -- (I) coordinate[pos=0.9](Ivor);
\path[] (I) -- (PN) coordinate[pos=0.1](Inach); ;
\draw[blue] (N) -- (Ivor);
\draw[blue] (Inach) -- (PN);
\draw[edge] (M) |- (Q);
\path (N) -- (I) node[pos=.5,above,sloped] {Kartoffel};
\path (M) |- (I) node[pos=.75,above] {Handball};
\end{tikzpicture}
\end{document}
Übermalen gefällt mir meistens nicht so sehr, ich würde es hier mit [tt]shorten[/tt] machen:
[attachment=1]5555555.png[/attachment]
[code]\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex}}
\node[vertex] (M) at (-10,0) {M};
\node[vertex] (N) at (-6,0) {N};
\node[vertex] (PN) at (0,11) {PN};
\node[vertex] (Q) at (0,6) {Q};
\path[edge,name path=L1] (N) -- (PN);
\path[name path=L2] (M) |- (Q);
% Alt
%\fill [name intersections={of=L1 and L2,by=I},fill=red] (I) circle (.5cm);
% Neu
\path[name intersections={of=L1 and L2,by=I},label=I];
\draw[red, shorten >=4mm] (N) -- (I);
\draw[red, shorten <=4mm] (I) -- (PN);
\draw[edge] (M) |- (Q);
\path (N) -- (I) node[pos=.5,above,sloped] {Kartoffel};
\path (M) |- (I) node[pos=.75,above] {Handball};
\end{tikzpicture}
\end{document}[/code]
PS: [tt]shorten[/tt] kann mitunter auch problematisch sein, man kann auch echte Koordinaten vor und nach dem Schnittpunkt platzieren:
[attachment=0]5555555.png[/attachment]
[code]
\documentclass[tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex}}
\node[vertex] (M) at (-10,0) {M};
\node[vertex] (N) at (-6,0) {N};
\node[vertex] (PN) at (0,11) {PN};
\node[vertex] (Q) at (0,6) {Q};
\path[edge,name path=L1] (N) -- (PN);
\path[name path=L2] (M) |- (Q);
% Alt
%\fill [name intersections={of=L1 and L2,by=I},fill=red] (I) circle (.5cm);
% Neu 2
\path[name intersections={of=L1 and L2,by=I},label=I];
\path[] (N) -- (I) coordinate[pos=0.9](Ivor);
\path[] (I) -- (PN) coordinate[pos=0.1](Inach); ;
\draw[blue] (N) -- (Ivor);
\draw[blue] (Inach) -- (PN);
\draw[edge] (M) |- (Q);
\path (N) -- (I) node[pos=.5,above,sloped] {Kartoffel};
\path (M) |- (I) node[pos=.75,above] {Handball};
\end{tikzpicture}
\end{document}[/code]