I am trying to display a pH scale in LaTeX but Im having trouble figuring it out. All the googling I have been able to do just brings up the pH levels of Latex the material. Can someone offer some advice/resources?
1 Answer
Update: pH scale with colors in https://en.wikipedia.org/wiki/PH_indicator. (Paul Gaborit suggested)
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[xscale=.6,font=\sffamily]
\fill[left color=red,right color=orange]
(0,0) rectangle (3,1);
\fill[left color=orange,right color=green]
(3,0) rectangle (7.5,1);
\fill[left color=green,right color=blue]
(7.5,0) rectangle (12,1);
\fill[left color=blue,right color=violet]
(12,0) rectangle (15,1);
\draw[white] (0,0) grid (15,1);
\foreach \i in {0,...,14}
\path (\i+.5,0) node[below]{\i};
\path
(0,1) node[above right]{Acidic}
(7.5,1) node[above]{Neutral}
(15,1) node[above left]{Alkaline};
\path (current bounding box.south) node[below=2mm,scale=1.5]{\bfseries pH scale};
\end{tikzpicture}
\end{document}
I choose red for Axidic, violet for Neutral, and cyan for Alkaline. Tell me if you have a better choice of colors for pH scale.
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[xscale=.6,font=\sffamily]
\fill[left color=red,middle color=violet,right color=cyan] (0,0) rectangle (15,1);
\draw[white] (0,0) grid (15,1);
\foreach \i in {0,...,14} \path (\i+.5,0) node[below]{\i};
\path
(0,1) node[above right]{Acidic}
(7.5,1) node[above]{Neutral}
(15,1) node[above left]{Alkaline};
\path (current bounding box.south) node[below=2mm,scale=2]{\bfseries pH scale};
\end{tikzpicture}
\end{document}
-
4Suggestion for the colors : en.wikipedia.org/wiki/Universal_indicator Feb 12, 2020 at 14:23
-
\documentclass{article} \usepackage[table]{xcolor} \begin{document} \begin{tabular}{p{1cm}p{1cm}p{1cm}} \hfil 0 & \hfil 7 & \hfil 14 \\ \cellcolor{red} & \cellcolor{green} & \cellcolor{blue}\\ \end{tabular} \end{document}
\includegraphics