TikZ and figures

Use your favourite software to make pictures

It is possible to type code that draws figures directly in to LaTeX documents. On the whole it is better to use external software to create figures as graphical files. I use Matlab for most things and Inkscape or IPE for everything else. (I cannot recommend IPE for general users but it is an excellent tool if you want to put in the work to learn its idiosyncrasies.) Many people prefer to use R or Python for graphs, while others will use Excel.

Any software that can save or export graphics files (pdf, bmp, jpg, tiff) can be used to create figures for LaTeX documents using the setup detailed in my courses.

The results using TikZ to draw figures are excellent, and for people who love to code it is fun and flexible. But for the average LaTeX user the whole thing is an extra complication that is entirely unnecessary.

This is not for everyone!

If you use a package called TikZ then you can type code to draw pictures directly in to the document - there is an example document at the bottom of this page. It is also possible to use a graphical editor like TikzEdt (which is free) to help you write and edit the code.

Details of TiczEdt can be found here ►

% 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 `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$};     }     
            \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}