admin管理员组

文章数量:1400503

I am trying to draw the red,dashed line to enclose 3 nodes so that it forms a curved space. It should follow the curve of the circle. Tried to use different coordinates.

Is this the problem with the coordinates ?

    \begin{tikzpicture}[auto,
            > = Stealth,
    every edge quotes/.style = {font=\footnotesize}, % if you like to have smaller 
edge labels
every edge/.append style = {->, draw=cyan, thick},
every loop/.append style = {<-, looseness = 12},
node distance = 12mm,
 state/.style = {circle, semithick, draw=cyan, text=cyan, minimum size=1.2em},
ellipsefit/.style = {draw=red, thick, dashed, ellipse},
      rect/.style = {rectangle, draw=cyan, thick, minimum width=2.5cm, minimum height=1.5cm, align=center}
]\def\radius{3}
\foreach \a in {1,2,3,4,5} {
        \node[state] (N\a) at ({\a*360/5}:\radius) {Node \a};
    }
\path (N5) edge[bend right=20] (N1);
\path (N1) edge[bend right=20] (N2);
\path (N2) edge[bend right=20] (N3);
\path (N3) edge[bend right=20] (N4);
\path (N4) edge[bend right=20] (N5);
\draw[red, thick, dashed]
    plot[smooth cycle, tension=1] coordinates {
        ($(N1) + (0.7, 0.7)$)
        ($(N2) + (-0.8, 1.5)$)
        ($(N3) + (0.7, -0.8)$)
    };
    \end{tikzpicture}

I tried to change the coordinates.

Update : It appears to improve if I understand the grid and try to pull the curve.

\draw[ultra thick,blue]
  (-3.9,1.9)
    .. controls (3.3,6.5) and (5,3) ..
    (-1,-2)
    .. controls (-1.2,-3.3) and (-3.9,-4.8) ..
    (-3.9,1.9);

本文标签: tikzCreate curved enclosing space to cover nodesStack Overflow