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.

Download as: [PDF] [TEX]

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
    % Axes:
    % Are simply drawn using line with the `->` option to make them arrows:
    % The main labels of the axes can be places using `node`s:
    \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 `node`s. 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$};
    % 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$};


  • #1 Memento, September 4, 2012 at 7:03 p.m.

    Cannot compile any of these samples. For example for this one:

    Preview: Fontsize 10pt ! Missing number, treated as zero. \advance l.39 }

Adding comments is currently not enabled.