[Tex/LaTex] TikZ Nodes not exactly centered

nodespositioningtikz-pgf

In my solution to draw a plot with point, it was pointed out that the nodes containing \textbullet and $\circ$ were not placed exactly centered at the specified point. I found this hard to believe but it does indeed appear to be the case.

Here is an image magnified to 2400% which shows this. The left pictures is:

\node [red] at (0,0) {\textbullet};
\draw [brown]  (0,0) circle (3pt);

and the right is:

\node [blue] at (1,0) {$\circ$};
\draw [brown]   (1,0) circle (3pt);

Clearly both are not centered at the given point.

enter image description here

Questions:

  1. I though that nodes were centered by default so what is different in this case?
  2. How would you ensure that these are placed with their centers at the specified point?

Code:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw [very thin, gray] (-1,-1) grid (2,1);

\node [red] at (0,0) {\textbullet};
\draw [brown]  (0,0) circle (3pt);

\node [blue] at (1,0) {$\circ$};
\draw [brown]   (1,0) circle (3pt);
\end{tikzpicture}
\end{document}

Best Answer

The bounding box of a character always includes the baseline point:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach \txt[count=\c] in {\textbullet,$\circ$,',x}{
  \node [inner sep=0pt,draw=red,line width=.1pt,text=violet](a) at (.25*\c,0) {\txt};
  \draw [brown]  (.25*\c,0) circle (3pt);
  \fill (.25*\c,0) circle[radius=.1pt];
  \fill (a.base) circle[radius=.1pt];
}
\end{tikzpicture}
\end{document}

enter image description here