![есть ли возможность вращать текст в дереве (tikz)?](https://rvso.com/image/327776/%D0%B5%D1%81%D1%82%D1%8C%20%D0%BB%D0%B8%20%D0%B2%D0%BE%D0%B7%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE%D1%81%D1%82%D1%8C%20%D0%B2%D1%80%D0%B0%D1%89%D0%B0%D1%82%D1%8C%20%D1%82%D0%B5%D0%BA%D1%81%D1%82%20%D0%B2%20%D0%B4%D0%B5%D1%80%D0%B5%D0%B2%D0%B5%20(tikz)%3F.png)
Есть ли возможность сделать мое дерево немного более упорядоченным? На данный момент, я думаю, там много беспорядка, и вы не понимаете, какое описание относится к какой строке и т. д. Надеюсь, вы понимаете, что я имею в виду. Я думала расположить его как на фото, но не понимаю (как повернуть текст, чтобы он был на строке). Есть ли кто-нибудь, кто может мне помочь? Спасибо!!
\begin{document}
\begin{center}
\begin{tikzpicture}
[dot/.style={inner sep=0pt,minimum size=10pt,fill=black,circle}, ring/.style={inner sep=0pt,minimum size=10pt,draw,circle}]
\node[dot,label=90:{Spieler 1}] (n11) at (0,0) {};
\node[dot,label=135:{Spieler 2}] (n21) at (-4,-1) {};
\node[ring,label=:{}] (n22) at (4,-1) {};
\node[dot,label=-90:{$(0,0)$}] (n31) at (-6,-4) {};
\node[ring,label=:{}] (n32) at (-2,-4) {};
\node[dot,label=-90:{$(-1,1)$}] (n33) at (2,-4) {};
\node[dot,label=45:{Spieler 2}] (n34) at (6,-4) {};
\node[dot,label=-90:{$(1,-1)$}] (n41) at (-4,-7) {};
\node[dot,label=-90:{$(-2,2)$}] (n42) at (0,-7) {};
\node[ring,label=:{}] (n43) at (4,-7) {};
\node[dot,label=-90:{$(0.5,-0.5)$}] (n44) at (8,-7) {};
\node[dot,label=-90:{$(1,-1)$}] (n51) at (2,-10) {};
\node[dot,label=-90:{$(0,0)$}] (n52) at (6,-10) {};
\draw (n11) -- node[label=135:{passen}] {} (n21);
\draw (n11) -- node[label=45:{drehen}] {} (n22);
\draw (n21) -- node[label=135:{passen}:sloped] {} (n31);
\draw (n21) -- node[label=45:{drehen}] {} (n32);
\draw (n22) -- node[label=135:{Schuss}] {} (n33);
\draw (n22) -- node[label=45:{kein Schuss}] {} (n34);
\draw (n32) -- node[label=135:{Schuss}] {} (n41);
\draw (n32) -- node[label=45:{kein Schuss}] {} (n42);
\draw (n34) -- node[label=135:{passen}] {} (n43);
\draw (n34) -- node[label=45:{drehen}] {} (n44);
\draw (n43) -- node[label=135:{Schuss}] {} (n51);
\draw (n43) -- node[label=45:{kein Schuss}] {} (n52);
\end{tikzpicture}
\end{center}
\end{document}
решение1
Вам нужны узлы, например node[label=135:{passen}] {}
change with node[above,sloped] {passen}
. С этим вы получите:
Полный код:
\documentclass[border=3mm,
tikz,
preview
]{standalone}
\begin{document}
\begin{center}
\begin{tikzpicture}[
dot/.style={circle, fill=black, inner sep=0pt, minimum size=10pt},
ring/.style={circle, draw, inner sep=0pt, minimum size=10pt}
]
\node[dot,pin=90:{Spieler 1}] (n11) at (0,0) {};
\node[dot,label=135:{Spieler 2}] (n21) at (-4,-1) {};
\node[ring] (n22) at (4,-1) {};
\node[dot,label=-90:{$(0,0)$}] (n31) at (-6,-4) {};
\node[ring] (n32) at (-2,-4) {};
\node[dot,label=-90:{$(-1,1)$}] (n33) at (2,-4) {};
\node[dot,label=45:{Spieler 2}] (n34) at (6,-4) {};
\node[dot,label=-90:{$(1,-1)$}] (n41) at (-4,-7) {};
\node[dot,label=-90:{$(-2,2)$}] (n42) at (0,-7) {};
\node[ring] (n43) at (4,-7) {};
\node[dot,label=-90:{$(0.5,-0.5)$}] (n44) at (8,-7) {};
\node[dot,label=-90:{$(1,-1)$}] (n51) at (2,-10) {};
\node[dot,label=-90:{$(0,0)$}] (n52) at (6,-10) {};
\draw (n11) -- node[above,sloped] {passen} (n21);
\draw (n11) -- node[above,sloped] {drehen} (n22);
\draw (n21) -- node[above,sloped] {passen} (n31);
\draw (n21) -- node[above,sloped] {drehen} (n32);
\draw (n22) -- node[above,sloped] {Schuss} (n33);
\draw (n22) -- node[above,sloped] {kein Schuss} (n34);
\draw (n32) -- node[above,sloped] {Schuss} (n41);
\draw (n32) -- node[above,sloped] {kein Schuss} (n42);
\draw (n34) -- node[above,sloped] {passen} (n43);
\draw (n34) -- node[above,sloped] {drehen} (n44);
\draw (n43) -- node[above,sloped] {Schuss} (n51);
\draw (n43) -- node[above,sloped] {kein Schuss} (n52);
\end{tikzpicture}
\end{center}
\end{document}