We'll walk through how I made a figure to visualise Hausdorff spaces in TikZ.
TikZ is a LaTeX library which allows you to draw diagrams, figures, graphs, and anything else which you can think up. It’s my go-to for drawing complex diagrams because of it’s reliance on declarative nature. Also, the implementation of the commands is very neat, and natural.
The minimal setup for creating a TikZ figure is as follows,
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
% TikZ goes here.
\end{document}
which will output a .pdf
file, with minimal dimensions. You can include the
graphics generated in a master file with the \includegraphics{}
command.
Knowing the mathematical significance of Hausdorff spaces is not a pre-requisite for learning TikZ, so just believe me that the figure we will produce is useful in the visualisation of such spaces.
We start with a rounded box which will act as our topological space, and label this by X.
\draw plot[smooth cycle] coordinates {(-1,-1) (1,-1) (1,1) (-1,1)};
\node[above left] at (-1,1) {$ X $};
Then define nodes at two points in the space.
\coordinate (u) at (0.2,0.7);
\coordinate (v) at (-0.5, -0.2);
\fill (u) circle (0.05) node[below]{$ u $};
\fill (v) circle (0.05) node[below]{$ v $};
You might think that defining coordinates is overkill here, but I think that the flexibility that this gives you down the line is worth the verbosity. We now draw open sets around these points.
\filldraw[dashed, fill=gray!50, fill opacity=0.5] (u) circle (0.4);
\filldraw[dashed, fill=gray!50, fill opacity=0.5] (v) circle (0.4);
And reorder the code to place the labels above these open sets.
\filldraw[dashed, fill=gray!50, fill opacity=0.5] (u) circle (0.4);
\filldraw[dashed, fill=gray!50, fill opacity=0.5] (v) circle (0.4);
\fill (u) circle (0.05) node[below]{$ u $};
\fill (v) circle (0.05) node[below]{$ v $};
That’s it! Our open sets don’t intersect, and this gives a good depiction for what it means for a space to be Hausdorff.