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.
Questions:
- I though that nodes were centered by default so what is different in this case?
- 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: