# Example: Circle in the complex plane

Published 2012-01-06 | Author: Martin Scharrer
Answer to a question on TeX.SX: Drawing a circle in the complex plane.

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de. En français: TeXnique.fr.

% Drawing a circle in the complex plane
% Author: Martin Scharrer
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{scope}[thick,font=\scriptsize]
% Axes:
% Are simply drawn using line with the -> option to make them arrows:
% The main labels of the axes can be places using nodes:
\draw [->] (-5,0) -- (5,0) node [above left]  {$\Re\{z\}$};
\draw [->] (0,-5) -- (0,5) node [below right] {$\Im\{z\}$};

% Axes labels:
% Are drawn using small lines and labeled with nodes. The placement can be set using options
\iffalse% Single
% If you only want a single label per axis side:
\draw (1,-3pt) -- (1,3pt)   node [above] {$1$};
\draw (-1,-3pt) -- (-1,3pt) node [above] {$-1$};
\draw (-3pt,1) -- (3pt,1)   node [right] {$i$};
\draw (-3pt,-1) -- (3pt,-1) node [right] {$-i$};
\else% Multiple
% If you want labels at every unit step:
\foreach \n in {-4,...,-1,1,2,...,4}{%
\draw (\n,-3pt) -- (\n,3pt)   node [above] {$\n$};
\draw (-3pt,\n) -- (3pt,\n)   node [right] {$\n i$};
}
\fi
\end{scope}
% The circle is drawn with (x,y) circle (radius)
% You can draw the outer border and fill the inner area differently.
% Here I use gray, semitransparent filling to not cover the axes below the circle
\path [draw=none,fill=gray,semitransparent] (+1,-1) circle (3);
% Place the equation into the circle:
\node [below right,darkgray] at (+1,-1) {$|z-1+i| \leq 3$};
\end{tikzpicture}
\end{document}