135

How is it possible to change the size of a node, for example:

\begin{tikzpicture}
     \draw  node[fill,circle]{} (0,0);%
\end{tikzpicture}

How to make the circle smaller or larger?

2
  • Related Question: Size of TikZ ellipse node. Mar 21, 2013 at 3:40
  • 1
    @student I’m sure you use place nodes differently (“more corrent”) by now, though I want to add for other visitors, that you actually do not draw the node but only fill it (despite the \draw, yes). Also the node is only placed by default at (0,0). The last (0,0) bit is just a move to the coordinate (0,0). Mar 21, 2013 at 3:57

2 Answers 2

140

The node size normally depends on the size of the content. Your node is empty so it is relative small. If you want to set the size manually use the minimum width and/or minimum height or set both at the same time using minimum size.

The circle shapes just uses the greatest of both values, otherwise you may be interested in the ellipse shape.

\begin{tikzpicture}
     \draw node[fill,circle,minimum size=2cm] {};
\end{tikzpicture}

If you want to mark the node even smaller than it is in your question, set the inner sep value lower. It causes an empty node to still have some size. Best set it to 0pt and then use minimum size.

If you only fill the node and do not draw its border (as you do in your example despite the \draw command (that does not affect nodes on the path)), you might also set the outer sep to 0pt, so that paths will actually connect to it.
If you do not reference the node later, you could actually just use the circle path operator, where you can specify a radius very simple: \draw (0,0) circle [radius=<value>];

\begin{tikzpicture}
     \draw  node[fill,circle,inner sep=0pt,minimum size=1pt] {};
\end{tikzpicture}
4
  • can you set a default value for "minimum size" within a document?
    – drevicko
    Jun 11, 2015 at 4:20
  • 1
    @drevicko: Try \tikzset{minimum size=..}. If this doesn't work check the PGF/TikZ manual for an "every node" or similar setting. Jun 11, 2015 at 17:39
  • inner sep reduces the horizontal size of the node. How can I reduce the vertical size? Dec 7, 2020 at 16:45
  • @EliasStrehle: inner sep reduces both the horizontal and vertical size. There is apparently something else there in your case which caues the vertical size. Dec 8, 2020 at 7:59
53
\begin{tikzpicture}
     \draw  node[fill,circle,scale=0.3]{} (0,0);%
\end{tikzpicture}
2
  • 10
    Note that the size of the empty node is determined by inner sep and scale simply scales this down in your code. Mar 16, 2011 at 7:26
  • scale is good. Pay attention however that it does affect also the coordinate at which you want to place your node in as well as xshift and yshift properties of the node. A better option might be inner sep = 0.3ex instead of scale = 0.3 for example try this \node[circle, inner sep = 0.3ex, thick, fill, black] at (30: 15ex) (mynode){};
    – Master.AKA
    May 1, 2022 at 11:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .