2

I'm writing an article about physical chemistry, and I tried to plot what we call "Diagramme de distribution", it explains the growth of a given acid and its conjugated base... We call this function \alpha =\frac{[AH]}{[AH]+[A^-]} in function of pH, this one is given by pH=-\log[H_3O^+], so it's hard to get the function mathematically, since it's hard I want just to plot the following graph, without using the expression of the function itself. enter image description here

Thanks in advance.

7
  • 1
    I doubt that this question is for this site. It is more related to chemistry or math than to TeX and friends, which is dedicated how to write nice looking articles, books etc.
    – Zarko
    Dec 24, 2020 at 22:00
  • @Zarko No No I'm just trying to draw this nice looking graph without the use of "the function" because I tried many times to find the function but I couldn't ! I'll edit my post so it'll be more clear !
    – user209604
    Dec 24, 2020 at 22:04
  • 3
    Kind of looks like a logistic function, doesn't it? How about \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[declare function={L=100;k=2;x0=4.9;}] \begin{axis}[domain=0:14, no markers, samples=100] \addplot {L/(1+exp(-k*(x-x0)))}; \addplot {L/(1+exp(k*(x-x0)))}; \end{axis} \end{tikzpicture} \end{document}? Dec 24, 2020 at 22:07
  • There is already some code given on the page that features the image you show. Does this help you?
    – Karlo
    Dec 24, 2020 at 22:11
  • 2
    Than your question is very misleading!
    – Zarko
    Dec 24, 2020 at 22:46

1 Answer 1

8

If this is for a publication you should definitely find the correct function(s) and plot that, not use something that looks kind of like it. Actually, you should do that anyway ...

That said, an extended version of my comment, using a logistic function for the plot:

enter image description here

(Yes, I know the ticklabels aren't sans serif. I think there are a couple of questions about that around though, so searching a bit should help if with that if you want it.)

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots, mhchem}
\pgfplotsset{compat=1.17}
\begin{document}
\begin{tikzpicture}[
  declare function={L=100;k=2;x0=4.7;},
  every node/.append style={font=\small\sffamily}
]
\begin{axis}[
  small,
  width=10cm,
  height=5cm,
  domain=0:14,
  clip=false,
  samples=100,
  every axis plot/.append style={
    no markers,
    thick
  },
  axis lines=middle,
  grid,
  xtick distance=1,
  ytick distance=20,
  axis line style={shorten >=-8mm},
  xlabel={pH},
  ylabel={Proportions (\%)},
  ylabel style={above right, yshift=3mm},
  xlabel style={below right, xshift=3mm},
  ]
\addplot {L/(1+exp(-k*(x-x0)))} node[below, pos=0.95] {Base} node[above, pos=0.95] {\ce{A-}};
\addplot {L/(1+exp(k*(x-x0)))} node[below, pos=0.015] {Acide} node[above, pos=0.015] {\ce{AH}};

\draw [green, very thick] (x0, -10) node[below] {$\mathrm{pH}=\mathrm{p}K_A$} |- (-0.2, 50)  node[left] {50\%};
\end{axis}
\end{tikzpicture}
\end{document}
2
  • (+1) Thank you Sir !
    – user209604
    Dec 24, 2020 at 22:31
  • 1
    only for chemical completeness k=ln(10)
    – polyn
    Dec 24, 2020 at 22:58

You must log in to answer this question.