A few days ago the question came up how to draw Hägg diagrams with
.
Well for these kinds of diagrams there is an obvious choice: pgfplots.
[cce lang=”latex”]\documentclass{scrartcl}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\def\Ka{10^(-4.75)}% the equilibrium constant
\def\co{1}% the starting concentration
\begin{axis}[ymode=log,domain=0:14]
\addplot[red] { \co*10^(-x)/(\Ka+10^(-x)) };
\addplot[blue] { \co*\Ka/(10^(-x)+\Ka) };
\end{axis}
\end{tikzpicture}[/cce]
![Rendered by QuickLaTeX.com \LaTeX](https://www.cnltx.de/wp-content/ql-cache/quicklatex.com-03db84578d4b6941322a72efa84edbbc_l3.png)
![haegg-diagramm](https://faberstr.de/wp-content/uploads/2012/03/haegg-diagramm.png)