# Draw crosses in tikz

If I do

\draw (1,1) circle (1pt)

tikz draw a little circle with diameter 1pt at (1,1).

How can I define a path cross such that

\draw (1,1) cross (1pt)

draws a little cross with diameter 1pt (adjustable in size just like the circle)?

cross command equivalent to circle doesn't exist in TiKZ but you can use a cross out node from shapes.misc library. This kind of node adds a cross over node's text, but it's easy to adapt it to do what you want.

\tikzset{cross/.style={cross out, draw,
minimum size=2*(#1-\pgflinewidth),
inner sep=0pt, outer sep=0pt}}


Because circle (1pt) draws a circle with radius=1pt, its total size will be 2pt, then cross node's size is defined with minimum size=2*(#1-\pgflinewidth) and inner and outer separations fixed to 0pt.

If cross angle is not what you want, you can change it with rotate option. Next you have some examples. I've also placed circles over them just to show that circle and crosses have equal size.

\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{shapes.misc}

\tikzset{cross/.style={cross out, draw=black, minimum size=2*(#1-\pgflinewidth), inner sep=0pt, outer sep=0pt},
cross/.default={1pt}}

\begin{document}
\begin{tikzpicture}[]

\draw (0,0) circle (1pt);

\draw (.5,0) node[cross,rotate=10] {};
\draw (.5,0) circle (1pt);

\draw (0,.5) circle (1pt);
\draw (0,.5) node[cross,red] {};

\draw (.5,.5) node[cross,rotate=30] {};

\draw (0.25,.25) circle (2pt);
\draw (0.25,.25) node[cross=2pt,rotate=45,green]{};
\end{tikzpicture}
\end{document}


Alternative solution using pic:

\documentclass[]{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

\tikzset{
cross/.pic = {
\draw[rotate = 45] (-#1,0) -- (#1,0);
\draw[rotate = 45] (0,-#1) -- (0, #1);
}
}

\begin{document}

\begin{tikzpicture}

\draw (0,0) circle (1pt);

\path (.5,0) pic[rotate = 10] {cross=1pt};
\draw (.5,0) circle (1pt);

\draw (0,.5) circle (1pt);
\path (0,.5) pic[red] {cross=1pt};

\draw (.5,.5) pic[rotate = 30] {cross=1pt};

\draw (0.25,.25) circle (2pt);
\draw (0.25,.25) pic[rotate=45,green] {cross=2pt};
\end{tikzpicture}

\end{document}


• Notice that this solution always requires specification of the cross size. Is there anyone who knows how to modify this solution to add a default size? – Angelos Oct 15 '19 at 8:58