TikZ minimal node size

tikz-nodetikz-pgf

Even after setting text width=0pt, text height=0pt, inner sep=0pt as node parameters, and giving empty label, the node still has nonzero size. It seems to have both height and width equal 1 pt, as seen in the following code

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node[ultra thin,draw,text width=0pt,text height=0pt, inner sep=0pt] at (0,0) {};

\draw[ultra thin] (1pt,-.5pt)--(1pt,.5pt);
\end{tikzpicture}
\end{document}

Why is it so? Is there any secret parameter adding 1 pt to spacing? Is it possible to change it and produce smaller nodes?

Best Answer

The node size is determines by: minimum size (or minimum width, minimum height, etc., inner sep and outer sep. If you set them to zero, than node become equivalent to \coordinate. For comparison see the following MWE:

\documentclass[margin=3.141592, varwidth]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node[minimum size=0pt,inner sep=0pt, outer sep=0pt] (a) at (0,0)  {};
\draw[red] (a) -- + (2pt,0);
\draw[ultra thin] (1pt,-.5pt) -- (1pt,.5pt);

\scoped[yshift=1mm]
{
\node[coordinate] (a) at (0,0)  {};
\draw[red] (a) -- + (2pt,0);
\draw[ultra thin] (1pt,-.5pt) -- (1pt,.5pt);
}

\scoped[yshift=2mm]
{
\coordinate (a) at (0,0);
\draw[red] (a) -- + (2pt,0);
\draw[ultra thin] (1pt,-.5pt) -- (1pt,.5pt);
}
\end{tikzpicture}
\end{document}

At all cases the result is the same. The \coordinate is actually a node of zero size as is determined in the first example.

enter image description here