I am trying t draw a graph with some vertices using tikz, and am using nodes for my vertices. However \node[circle] (node1) (0,1) {1} gives a label of 1 inside the node. The node is also quite big. How do I make the node smaller? And how do I put the label outside of the node?

  • 2
    For example using \node[circle, inner sep=2pt, label={1}] (node1) at (0,1) {}; (don't forget at). Jul 26, 2022 at 21:04
  • What do you mean with "quite big". The node size is determined by its shape (here a circle), by the inner separators (/pgf/inner xsep, /pgf/inner ysep, i.e. padding), by the /pgf/minimum width and /pgf/minimum height and by its content itself or whatever was set via text width, text height and text depth. Aug 8, 2022 at 9:14

1 Answer 1

\documentclass[tikz, border=1cm]{standalone}
\node[circle, draw, red] (node1) at (0,0) {1};
\node[circle, draw, minimum size=1pt, label={1}] (node1) at (0,1) {};

Two circles and numbers

You must log in to answer this question.

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