Brill–Noether theory is dedicated to studying linear series on algebraic curves. I won't explain anything about it, but as I was reading up a bit on it in chapter V of the classic textbook Geometry of algebraic curves, by Arbarello–Cornalba–Griffiths–Harris, I noticed they had some pretty pictures, but they only gave the general idea, not actual examples where the Brill–Noether number is included on the graph. Which made my TikZ itch rear its head, so I quickly scratched it.

Without further explanation, here is the quick visualisation of the Brill–Noether numbers $\rho(g,d,r)=g-(r+1)(g-d+r)$ for $g=4$ and $g=10$. Below you find the TikZ code for arbitrary genus. Changing the value in \def\g{10} is enough to get a different picture.

\begin{tikzpicture}[scale=.5]
  \def\g{10}

  \pgfmathtruncatemacro\dmax{2*\g};
  \pgfmathtruncatemacro\rmax{\g+1};

  \draw[black!10!white] (0,0) grid (\dmax,\rmax);
  \draw[thick, ->] (-1,0) -- (\dmax+1,0) node [right] {$d$};
  \draw[thick, ->] (0,-1) -- (0,\rmax+1) node [left] {$r$};

  \draw[thick] (0,0) -- (2*\g-2,\g-1) -- (2*\g-1,\g-1); % Clifford line
  \draw[thick] (\g,0) -- (2*\g-1,\g-1); % Riemann--Roch line

  \draw[fill] (2*\g-2,\g-1) circle (2pt) node [above] {$\mathrm{K}_C$}; % canonical divisor
  \draw[fill] (\g,0) circle (2pt) node [below] {$g$};
  \draw[fill] (2*\g-2,0) circle (2pt) node [below] {$2g-2$};
  \draw[fill] (0,\g-1) circle (2pt) node [left] {$g-1$};

  \foreach \r in {1,...,\rmax} {
    \pgfmathtruncatemacro\rg{min(\dmax,\r+\g-1)}
    \foreach \d in {1,...,\rg} {
      \pgfmathtruncatemacro\rhodr{\g-(\r+1)*(\g-\d+\r)};
      \ifthenelse{\rhodr>-1}{\draw[fill] (\d,\r) circle (2pt) node {\quad\rhodr};}{}
    }
  }
\end{tikzpicture}

If you came here for pictures of the fine looking German gentleman that started Brill–Noether theory: Alexander von Brill and Max Noether. So it should actually be called von Brill–Noether theory, or maybe Noether–von Brill.