![Как получить изогнутую стрелку, начинающуюся и заканчивающуюся в одном узле](https://rvso.com/image/391711/%D0%9A%D0%B0%D0%BA%20%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B8%D1%82%D1%8C%20%D0%B8%D0%B7%D0%BE%D0%B3%D0%BD%D1%83%D1%82%D1%83%D1%8E%20%D1%81%D1%82%D1%80%D0%B5%D0%BB%D0%BA%D1%83%2C%20%D0%BD%D0%B0%D1%87%D0%B8%D0%BD%D0%B0%D1%8E%D1%89%D1%83%D1%8E%D1%81%D1%8F%20%D0%B8%20%D0%B7%D0%B0%D0%BA%D0%B0%D0%BD%D1%87%D0%B8%D0%B2%D0%B0%D1%8E%D1%89%D1%83%D1%8E%D1%81%D1%8F%20%D0%B2%20%D0%BE%D0%B4%D0%BD%D0%BE%D0%BC%20%D1%83%D0%B7%D0%BB%D0%B5.png)
Привет, я пытаюсь повторить график ниже. Я сделал большую часть, но не могу понять, как сделать так, чтобы стрелка начиналась и заканчивалась в
Мне удалось получить следующую фигуру. И я застрял на создании стрелок на узле E.
Я прикрепил код ниже
\tikzstyle{state} = [circle, minimum width=2cm, draw=black]
\begin{tikzpicture}[very thick, ->, >=stealth,auto, node distance=4cm]
\node(shift) [state] {Shift $=1$};
\node [above of=shift, yshift=-3.5cm] {S};
\node(add) [state, right of=shift] {Add $=1$};
\node [above of=add, yshift=-3.5cm] {A};
\node(init) [state, right of=add] {Init $=1$};
\node [above of=init, yshift=-3.5cm] {I};
\node(control) [state, below of=add] {};
\node [above of=control, yshift=-3.5cm] {C};
\node(others) [state, below of=control] {};
\node [above of=others, yshift=-3.5cm] {Others};
\node(end) [state, right of=control] {Done $=1$};
\node [above of=end, yshift=-3.5cm] {E};
\node(reset) [circle, draw=black, fill=black, right of=end, xshift=-1.5cm] {};
\node [above of=reset, yshift=-3.5cm] {Reset};
\path (add) edge node [above] {$1$} (shift);
\path (shift) edge[bend right] node [below left] {LSB/Stop $=00$} (control);
\path (control) edge[] node [above right] {$1$} (shift);
\path (control) edge[] node [right] {LSB $=1$} (add);
\path (init) edge[] node [below right] {$1$} (control);
\path (end) edge[] node [right] {Start $=1$} (init);
\path (control) edge[] node [above] {$01$} (end);
\path (others) edge[] node [above left] {$1$} (end);
\path (reset) edge[] node [] {} (end);
\end{tikzpicture}
решение1
Так ?(см. пояснения в комментариях)
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\tikzstyle{state} = [circle, minimum width=2cm, draw=black]
\begin{tikzpicture}[very thick, ->, >=stealth,auto, node distance=4cm]
\node(shift) [state] {Shift $=1$};
\node [above of=shift, yshift=-3.5cm] {S};
\node(add) [state, right of=shift] {Add $=1$};
\node [above of=add, yshift=-3.5cm] {A};
\node(init) [state, right of=add] {Init $=1$};
\node [above of=init, yshift=-3.5cm] {I};
\node(control) [state, below of=add] {};
\node [above of=control, yshift=-3.5cm] {C};
\node(others) [state, below of=control] {};
\node [above of=others, yshift=-3.5cm] {Others};
\node(end) [state, right of=control] {Done $=1$ };
\draw (end) to [in=-40,out=220,looseness=5,min distance=30mm]node[above]{Start $=0$} (end);% <------ loop Start=0
\node [above of=end, yshift=-3.5cm] {E };
\node(reset) [circle, draw=black, fill=black, right of=end, xshift=-1.5cm] {};
\node [above of=reset, yshift=-3.5cm] {Reset};
\path (add) edge node [above] {$1$} (shift);
\path (shift) edge[bend right] node [below left] {LSB/Stop $=00$} (control);
\path (control) edge[] node [above right] {$1$} (shift);
\path (control) edge[] node [right] {LSB $=1$} (add);
\path (init) edge[] node [below right] {$1$} (control);
\path (end) edge[] node [right] {Start $=1$} (init);
\path (control) edge[] node [above] {$01$} (end);
\path (others) edge[] node [above left] {$1$} (end.200);%<--- arrows a little above
\path (reset) edge[] node [] {} (end);
%\node [circle,draw] at (end){} edge [in=30,out=60,loop] ();
\end{tikzpicture}
\end{document}
Приложение:
\tikzstyle
устарело, используйте \tikzset
вместо этого, что даст:
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
%\tikzstyle{state} = [circle, minimum width=2cm, draw=black]
\tikzset{state/.style={circle, minimum width=2cm, draw=black}}
\begin{tikzpicture}[very thick, ->, >=stealth,auto, node distance=4cm]
\node(shift) [state] {Shift $=1$};
\node [above of=shift, yshift=-3.5cm] {S};
\node(add) [state, right of=shift] {Add $=1$};
\node [above of=add, yshift=-3.5cm] {A};
\node(init) [state, right of=add] {Init $=1$};
\node [above of=init, yshift=-3.5cm] {I};
\node(control) [state, below of=add] {};
\node [above of=control, yshift=-3.5cm] {C};
\node(others) [state, below of=control] {};
\node [above of=others, yshift=-3.5cm] {Others};
\node(end) [state, right of=control] {Done $=1$ };
\draw (end) to [in=-40,out=220,looseness=5,min distance=30mm]node[above]{Start $=0$} (end);% <------ loop Start=0
\node [above of=end, yshift=-3.5cm] {E };
\node(reset) [circle, draw=black, fill=black, right of=end, xshift=-1.5cm] {};
\node [above of=reset, yshift=-3.5cm] {Reset};
\path (add) edge node [above] {$1$} (shift);
\path (shift) edge[bend right] node [below left] {LSB/Stop $=00$} (control);
\path (control) edge[] node [above right] {$1$} (shift);
\path (control) edge[] node [right] {LSB $=1$} (add);
\path (init) edge[] node [below right] {$1$} (control);
\path (end) edge[] node [right] {Start $=1$} (init);
\path (control) edge[] node [above] {$01$} (end);
\path (others) edge[] node [above left] {$1$} (end.200);%<--- arrows a little above
\path (reset) edge[] node [] {} (end);
\end{tikzpicture}
\end{document}