2

In the following picture the first graph has the correct bullet size, the second should have the same.

I would like the second one to be changed in order to get the right size of the bullet without having to specify the radius in the body but only in the style definition. Why? Because I prefer the approach of the second graph.

enter image description here

\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}
  • \draw (18:1cm) node (2){} -- (90:1cm) node (3){} -- (162:1cm) node (4){} -- (234:1cm) node (5){} -- (306:1cm) node (1){} -- (2);? That is, the size of the bullets is so large because the nodes have contents and fit these contents. – user121799 Jun 29 at 14:29
  • @marmot I would like this [bullet/.style={circle, fill, minimum size=2pt, inner sep=0pt, outer sep=0pt},nodes=bullet] to be changed, and not the part you posted in the comment. – PeptideChain Jun 29 at 14:31
  • @marmot I understand... hmm. And how I get a circle with 2pt radius and a label? – PeptideChain Jun 29 at 14:33
  • @marmot going from \coordinate to node change many aspects – PeptideChain Jun 29 at 14:34
  • As long as you give the nodes contents, these contents will show, You get a circle by either using a node or a pic. Yes, going from coordinate to node changes many aspects, and giving the nodes contents leads to additional changes. – user121799 Jun 29 at 14:34
4

This adds labels and makes the bullets the same size as the circles.

\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}

enter image description here

3

For theoretical interests:

I think you are looking for:

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

Compare:

\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}

Same size of the last two ones:

enter image description here

So

enter image description here

\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}
  • Sorry, what is bullet/.style={circle, fill, draw=red, minimum size=4pt-\pgflinewidth, inner sep=0pt, outer sep=0pt} good for? You add a draw and then subtract the line width to maintain the overall size. For single-color nodes it is arguably easier not to add draw, and not to subtract anything. AFAIK the OP wanted single-color nodes. – user121799 Jun 29 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.