如何在 TikZ 上绘制带箭头的重叠圆圈

如何在 TikZ 上绘制带箭头的重叠圆圈

我想绘制三个半径和圆心不同的重叠圆。但是,我希望圆的轮廓部分不可见(想象气泡彼此相邻)。此外,我希望圆的轮廓上有箭头(每个圆不一定位于相同的位置)。

我附上了一张我希望它看起来的样子的图画(如果图像没有自动显示,请单击“重叠圆圈”链接)。我曾尝试在 TikZ 上绘制它,但离我想要的效果还差得很远。任何帮助都将不胜感激。

重叠的圆圈

    \documentclass{article}
\usepackage{latexsym,pgf,makeidx,dsfont,authblk,boxedminipage,tikz}
\usetikzlibrary{decorations.markings}
\tikzset{>=latex}

\begin{document}
    
                \begin{tikzpicture}
        [scale=0.6,inner sep=0.5mm, 
        vertex/.style={circle,draw}, 
        thickedge/.style={line width=2pt}, decoration={
            markings,
            mark=at position 0 with {\arrow{<}}}, decoration={
            markings,
            mark=at position 0.42 with {\arrow{<}}}
        ] 
        
        \begin{scope}
            \draw[postaction={decorate}] (0,0) 
            arc (0:360:1);
            \draw[postaction={decorate}] (0.5,-1.25) 
            arc (0:360:1.25);
            \draw[postaction={decorate}] (3,-0.75) 
            arc (0:360:1.75);
        \end{scope}
        
    \end{tikzpicture}
\end{document}

答案1

像这样:

在此处输入图片描述

代码(您可以取消一些套餐……):

\documentclass{article}
\usepackage{latexsym,pgf,makeidx,dsfont,authblk,boxedminipage,tikz}
\usetikzlibrary{decorations.markings}
\tikzset{>=latex}

\begin{document}
    
    \begin{tikzpicture}
        [scale=1.6,inner sep=0.5mm, 
        vertex/.style={circle,draw}, 
        thickedge/.style={line width=2pt}, decoration={
            markings,
            mark=at position 0.3 with {\arrow{<}}}, decoration={
            markings,
            mark=at position 0.7 with {\arrow{<}}}
        ] 
        
        \begin{scope}
            \draw[postaction={decorate}] (3,-0.75) 
            arc (0:360:1.75);
            \filldraw[fill=white,draw=black,postaction={decorate}] (0,0) 
            arc (0:360:1);
            \filldraw[fill=white,draw=black,postaction={decorate}] (0.5,-1.25) 
            arc (0:360:1.25);   
        \end{scope}
        
    \end{tikzpicture}
\end{document}

答案2

通过绘制圆圈作为节点:

\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}
    \begin{tikzpicture}[
  C/.style = {circle, draw, ->-, fill=white, minimum size=#1, inner sep=0mm},
->-/.style = {decoration={markings,
                        mark=at position 0.3 with {\arrow{>}},
                        mark=at position 0.8 with {\arrow{>}}
                        },
              postaction={decorate}
              }
                        ]

\node[C=36mm]   {};                 % at bottom
\node[C=18mm]  at (240:18mm) {};    % in middle
\node[C= 9mm]  at (200:18mm) {};    % on top
    \end{tikzpicture}
\end{document}

在此处输入图片描述

微调(圆圈大小、圆圈位置、箭头位置和样式)我留给你了。

附录:
如果您喜欢在圆圈上单独定位箭头,那么上述建议的以下修改会很方便:

\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                decorations.markings}

\begin{document}
    \begin{tikzpicture}[
  C/.style args = {#1/#2/#3}{circle, draw, 
                            ->-=#1/#2, fill=white, minimum size=#3, % changed 
                            inner sep=0mm},
            > = {Straight Barb[length=1mm, line width=1pt]},        %  added for arrows' heads style
->-/.style args = {#1/#2}{decoration={markings,                     % changed
                        mark=at position #1 with {\arrow{>}},
                        mark=at position #2 with {\arrow{>}}
                        },
              postaction={decorate}
              }
                        ]
\node[C=0.4/0.9/36mm]   {};                 % at bottom
\node[C=0.2/0.7/24mm]  at (240:18mm) {};    % in middle
\node[C=0.2/0.6/12mm]  at (200:18mm) {};    % on top
    \end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

我设法得到了我想要的图片。然而,这是一个非常不优雅的解决方案。界

    \documentclass{article}
\usepackage{latexsym,pgf,makeidx,dsfont,authblk,boxedminipage,tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta,arrows}
\tikzset{>=latex}

\begin{document}
    

\begin{tikzpicture}
\coordinate (A) at (0, 0);
\draw (A) circle[radius=1.4];

\coordinate (B) at (-1.9, 1.2);
\coordinate (C) at (-1.9, -0.8);
\coordinate (D) at (-1.9, 3.2);
\fill[white] (B) circle (57pt);
%\fill[black] (C) circle (1pt);
%\fill[black] (D) circle (1pt);
\draw (B) circle[radius=2];
\draw[-{Latex[length=2mm, width=2mm]}] (C) arc (90:60:-2 and -2.15);
\draw[-{Latex[length=2mm, width=2mm]}] (D) arc (90:60:1 and 0.5);

\coordinate (E) at (1.6, 2.5);
\draw (E) circle[radius=2.7];
\fill[white] (E) circle (76.5pt);

\coordinate (F) at (0, -1.4);
%\fill[black] (F) circle (1pt);
\draw[-{Latex[length=2mm, width=2mm]}] (F) arc (90:60:1 and -0.6);

\coordinate (G) at (1.6, 5.2);
%\fill[black] (G) circle (1pt);
\draw[-{Latex[length=2mm, width=2mm]}] (G) arc (90:60:1 and 0.4);
\coordinate (H) at (1.6, -0.2);
%\fill[black] (H) circle (1pt);
\draw[-{Latex[length=2mm, width=2mm]}] (H) arc (90:60:-2 and -1.5);
    \end{tikzpicture}

\end{document} 

相关内容