如何改变箭头的方向(tikz)

如何改变箭头的方向(tikz)

当我写下这段代码时:

% Preview source code

%% LyX 2.3.1-1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands

\usepackage{tikz}
\usetikzlibrary{automata}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\begin{tikzpicture}
\node[state] (1) {$1$};
\path[->](1) edge [loop] ();
\end{tikzpicture}
\end{document}

我得到的是:
在此处输入图片描述

我如何将箭头的方向从左到右更改?

谢谢你!

答案1

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{automata}

\begin{document}
\begin{tikzpicture}
\node[state] (1) {$1$};
\path(1) edge [in=45,out=135,looseness=8,loop] ();
\node[state] (2) at (2,0) {$2$};
\path(2) edge [loop] ();
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容