如何绘制末端带有箭头的循环

如何绘制末端带有箭头的循环

我正在尝试绘制一个以某个点为起点和终点的循环箭头,但缺少箭头。以下是代码:

\begin{tikzpicture}

\node [circle,fill=black,inner sep=0,minimum size=4,label=below:\Large$P$] (P) at (0,0) {};
 
\draw (P) to [->,-stealth,thick,out=300,in=30,looseness=20] (P);

\end{tikzpicture}

显示的是一个循环,但没有箭头。如何修复它以显示箭头?

答案1

你想要这样的东西吗?

\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node [circle, draw] (P) at (0,0) {$P$};
\draw[->,>= stealth]  (P) edge [out=120,in=60,distance=15mm]   (P);
\end{tikzpicture}
\end{document} 

在此处输入图片描述

更接近您的原始帖子,您还可以使用:

\begin{tikzpicture}
\node [circle, draw, fill=black, label=below:$P$] (P) at (0,0) {};
\draw[->,>= stealth]  (P) edge [out=120,in=60,distance=15mm]   (P);
\end{tikzpicture}

获得

在此处输入图片描述

答案2

在此处输入图片描述

 \begin{tikzpicture}\tikzstyle{loop right} = [thick,->,>=stealth,  
    out=60,in=-60,looseness=20]
    
    
    \node [circle,fill=black,inner sep=0,minimum size=4pt,label= 
    {[yshift=-3pt]below:\Large$P$}] (P) at (0,0) {};
    
    \path (P) edge [loop right] (P);
    
 \end{tikzpicture}

相关内容