![트리(tikz)에서 텍스트를 회전할 수 있습니까?](https://rvso.com/image/327776/%ED%8A%B8%EB%A6%AC(tikz)%EC%97%90%EC%84%9C%20%ED%85%8D%EC%8A%A4%ED%8A%B8%EB%A5%BC%20%ED%9A%8C%EC%A0%84%ED%95%A0%20%EC%88%98%20%EC%9E%88%EC%8A%B5%EB%8B%88%EA%B9%8C%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}] {}
예를 들어 로 변경 하려면 노드가 필요합니다 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}