myChemistry

chemistry, typesetting and LaTeX

Hägg Diagrams

| 0 comments

A few days ago the question came up how to draw Hägg diagrams with \LaTeX.

Well for these kinds of diagrams there is an obvious choice: pgfplots.

\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
}

Leave a Reply

Required fields are marked *.