当有两个节点指向同一个节点时,由于它们指向同一个位置,所以图片看起来很奇怪。我该如何改变指向的位置?
例如,
\documentclass[10pt,letterpaper]{article}
\usepackage[latin1]{inputenc}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\def\xcolorversion{2.00}
\def\xkeyvalversion{1.8}
\usepackage[version=0.96]{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,petri,positioning}
\begin{document}
\textbf{DFA}\\
\begin{tikzpicture}[shorten >=1pt,node distance=3cm,on grid,auto]
\node[state,initial,accepting] (q_0) {$q_0$};
\node[state,accepting] (q_1) [right=of q_0] {$q_1$};
\node[state] (q_2) [right=of q_1] {$q_2$};
\node[state,accepting] (q_3) [right=of q_2] {$q_3$};
\node[state] (q_4) [above right=of q_3] {$q_4$};
\node[state,accepting] (q_5) [below right=of q_3] {$q_5$};
\path[->]
(q_0) edge [bend right] node {0} (q_1)
(q_0) edge [bend right] node {1} (q_3)
(q_1) edge [above,bend right] node {0} (q_0)
(q_1) edge [above,bend right] node {0} (q_3)
(q_2) edge node {0} (q_1)
(q_2) edge [above,bend left] node {0} (q_4)
(q_3) edge node {0,1} (q_5)
(q_4) edge node {0,1} (q_3)
(q_5) edge [loop below] node {0,1} (q_1)
; %end path
\end{tikzpicture}
\end{document}
我想要实现的是让一个箭头指向圆圈下方,另一个箭头指向其他地方。
答案1
in
您可以使用和out
选项固定输出和输入角度
(q_0) edge [bend right, out=-60, in=240] node {1} (q_3)