3

How do I draw a simple point using the tikz package? I can draw a line, a square, a circle and more, but not sure how to draw a point. I tried

\draw(0,0);

expecting it to plot a point, but that didn't work. Any help would be appreciated, thank you. :)

  • What shape should the point have? – Johannes_B Dec 14 '19 at 05:42
  • @Johannes_B Say, I have a circle and want to show its center, using a point, nothing extraordinary really. Is that possible to do using the tikz package? :) –  Dec 14 '19 at 05:47
  • \fill (0,0) circle[radius=0.5pt];? –  Dec 14 '19 at 05:47
  • @Schrödinger'scat Hey it worked! Thanks a bunch!! –  Dec 14 '19 at 05:49
  • 2
    A point has no dimensions ... You want to draw a circle around a point, which is different .... – cfr Dec 14 '19 at 05:55
  • Well, this is definitely a very clear instance of RTFM (Read The Fantastic Manual). – Henri Menke Dec 14 '19 at 06:01
  • Also this one could help: https://tex.stackexchange.com/questions/48538/how-to-set-exact-radius-for-a-node – CarLaTeX Dec 14 '19 at 06:20
  • @Schrödinger'scat I prefer the method of CarLatex something like \node[draw,circle,minimum size=1pt,inner sep=0pt,fill=blue!20] at (0,0){};. Useful to scale a picture without getting big points (small). – Alain Matthes Dec 18 '19 at 13:19
  • @Johannes_B, the point should be stroked witch the same style as every path passed to the \draw command. I have the same problem: How to force the \draw command to stroke the sigle points, eg. by \draw (0,0) -- (1,1) (1,0). Here is my problem: link – forrest Jan 11 '23 at 17:50
  • @cfr But the node has also dimensions. – ado sar Jun 04 '23 at 19:50

1 Answers1

1

I think you would like to use a node, in this way you can reference the point afterward.

What you need to set the exact radius is inner sep=0pt, as explained here.

I'll show you the difference in this simple example. In the first circle, the center node has inner sep=0pt; in the second circle, the center node has the standard inner sep:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node[draw,circle, minimum size=3cm, inner sep=0pt] (A) {};
\node[draw,circle, fill=black, inner sep=0pt, minimum width=1pt] (mycenter) at (A.center) {};
\node[draw,circle, minimum size=3cm, inner sep=0pt, below = of A] (B) {};
\node[draw,circle, fill=black, minimum width=1pt] (mycenter) at (B.center) {};
\end{tikzpicture}
\end{document} 

enter image description here

Prof. van Duck explained this feature in his article The Morse code of TikZ, see Section 3.1.

CarLaTeX
  • 62,716