Tikz 带节点的子弹半径

Tikz 带节点的子弹半径

在下图中,第一个图形具有正确的项目符号大小,第二个图形也应具有相同的大小。

我希望改变第二个以获得正确的子弹尺寸无需在主体中指定半径,只需在样式定义中指定即可。为什么?因为我更喜欢第二张图的方法。

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    \coordinate (1) at (0,0);
    \coordinate (2) at (0,-1);
    \coordinate (3) at (-1,0);
    \coordinate (4) at (-1,-1);
    \coordinate (5) at (1,0);
    \coordinate (6) at (1,-1);

    \draw (1) to[out=40,in=140,looseness=4,loop] (1) ;
    \draw (1) to[out=150,in=30] (3) ;
    \draw (1) to[out=210,in=-30] (3) ;
    \draw (5) to[out=150,in=30] (1) ;
    \draw (5) to[out=210,in=-30] (1) ;

    \draw (3) -- (4) ;
    \draw (1) -- (2) ;
    \draw (5) -- (6) ;
    \draw (4) -- (2) ;
    \draw (2) -- (6) ;
    \foreach \x in {(1), (2), (3), (4), (5), (6)}{
        \fill \x circle[radius=2pt];
    }
\end{tikzpicture}

\bigskip

\begin{tikzpicture}[bullet/.style={circle, fill, minimum size=2pt,
              inner sep=2pt, outer sep=0pt},nodes=bullet]
    \draw (18:1cm) node (2){} -- (90:1cm) node (3){} -- (162:1cm) node (4){} -- 
          (234:1cm) node (5){} -- (306:1cm) node (1){} -- (2);
\end{tikzpicture}


\end{document}

答案1

这会添加标签并使项目符号与圆圈大小相同。

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    \coordinate (1) at (0,0);
    \coordinate (2) at (0,-1);
    \coordinate (3) at (-1,0);
    \coordinate (4) at (-1,-1);
    \coordinate (5) at (1,0);
    \coordinate (6) at (1,-1);

    \draw (1) to[out=40,in=140,looseness=4,loop] (1) ;
    \draw (1) to[out=150,in=30] (3) ;
    \draw (1) to[out=210,in=-30] (3) ;
    \draw (5) to[out=150,in=30] (1) ;
    \draw (5) to[out=210,in=-30] (1) ;

    \draw (3) -- (4) ;
    \draw (1) -- (2) ;
    \draw (5) -- (6) ;
    \draw (4) -- (2) ;
    \draw (2) -- (6) ;
    \foreach \x in {(1), (2), (3), (4), (5), (6)}{
        \fill \x circle[radius=2pt];
    }
\end{tikzpicture}

\bigskip

\begin{tikzpicture}[bullet/.style={circle, fill,minimum size=4pt,
              inner sep=0pt, outer sep=0pt},nodes=bullet]
    \draw (18:1cm) node[label=18:A] (2){} 
    -- (90:1cm) node[label=90:B] (3){} -- (162:1cm) node[label=162:C] (4){} -- 
          (234:1cm) node[label=234:D] (5){} -- (306:1cm) node[label=306:E] (1){} -- (2);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

出于理论兴趣:

我认为您正在寻找:

bullet/.style={circle, fill,  
minimum size=4pt,
inner sep=0pt, outer sep=0pt},nodes=bullet

比较:

\begin{tikzpicture}
\draw (0,-2) node[minimum size=2cm,draw,circle] {2cm};

\draw (0,-2) node[minimum size=4cm,draw,circle] {};
\draw[red] (0,-2) circle(2cm);
\end{tikzpicture}

最后两个的大小相同:

在此处输入图片描述

所以

在此处输入图片描述

\documentclass[margin=5mm, tikz]{standalone}
%\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[bullet/.style={circle, fill,  
minimum size=4pt,
inner sep=0pt, outer sep=0pt},nodes=bullet]
    \coordinate (1) at (0,0);
    \coordinate (2) at (0,-1);
    \coordinate (3) at (-1,0);
    \coordinate (4) at (-1,-1);
    \coordinate (5) at (1,0);
    \coordinate (6) at (1,-1);

    \draw (1) to[out=40,in=140,looseness=4,loop] (1) ;
    \draw (1) to[out=150,in=30] (3) ;
    \draw (1) to[out=210,in=-30] (3) ;
    \draw (5) to[out=150,in=30] (1) ;
    \draw (5) to[out=210,in=-30] (1) ;

    \draw (3) -- (4) ;
    \draw (1) -- (2) ;
    \draw (5) -- (6) ;
    \draw (4) -- (2) ;
    \draw (2) -- (6) ;
    \foreach \x in {(1), (2), (3), (4), (5), (6)}{
 \node[bullet, red, outer sep=0pt, xshift=4pt] at \x {};
\fill \x circle[radius=2pt];
%\node[bullet, red] at \x {};
    }
\end{tikzpicture}

\bigskip

\begin{tikzpicture}[bullet/.style={circle, fill, minimum size=2pt,
              inner sep=2pt, outer sep=0pt},nodes=bullet]
    \draw (18:1cm) node (2){} -- (90:1cm) node (3){} -- (162:1cm) node (4){} -- 
          (234:1cm) node (5){} -- (306:1cm) node (1){} -- (2);
\end{tikzpicture}

\begin{tikzpicture}
\draw (0,-2) node[minimum size=2cm,draw,circle] {2cm};

\draw (0,-2) node[minimum size=4cm,draw,circle] {};
\draw[red] (0,-2) circle(2cm);
\end{tikzpicture}


\end{document}

相关内容