Skip to content

Instantly share code, notes, and snippets.

@BartoszMilewski
Created June 17, 2021 23:00
Show Gist options
  • Save BartoszMilewski/a52f0caf352a52332a91b8fa7a492298 to your computer and use it in GitHub Desktop.
Save BartoszMilewski/a52f0caf352a52332a91b8fa7a492298 to your computer and use it in GitHub Desktop.
Tikz string diagram illustrating the unit of adjunction
\begin{tikzpicture}
\def \xrightmost {2}
\def \xright {1}
\def \xmid {0}
\def \xleft {-\xright}
\def \xleftmost {-\xrightmost}
\def \ybot {0}
\def \ymid {1}
\def \ytop {2}
\def \ylabel {\ytop - 0.3}
% functor labels
\node [above] at (\xleft, \ytop) {$L$};
\node [above] at (\xright, \ytop) {$R$};
% background
\filldraw[fill=orange!30, draw=white] (\xleftmost, \ytop) rectangle (\xrightmost, \ybot);
% cup
\draw [fill=blue!50!green!20] (\xleft, \ytop) to [out=-90, in=180] (\xmid, \ymid) to [out=0, in=-90] (\xright, \ytop);
% natural transformation
\filldraw [black] (\xmid, \ymid) circle (1 pt);
\node [below] at (\xmid, \ymid) {$\eta$};
% category labels
\node at (\xmid, \ylabel) {$\mathcal{C}$};
\node [right] at (\xleftmost, \ylabel) {$\mathcal{D}$};
\end{tikzpicture}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment