This question is aimed at building on the great solution provided here. NB the link to the plot which serves as a great example of what we are building.
For simplicity's sake, consider the following example:
\documentclass[tikz]{standalone}
\usetikzlibrary{calc,fadings}
\usepackage{miscchemsym}
\def\solutelength{1}
\def\soluteheight{.5}
\def\solutevariabilityhigh{0}
\def\solutevariabilitylow{0}
\def\solutelabelcolor{black}
\tikzset{
pics/solute/.default={s-s},
pics/solute/.style args={#1-#2}{
code={
\def\hasfading{f}
\def\stylehigh{#2}
\def\stylelow{#1}
\coordinate (-north) at ({.5\solutelength},\soluteheight);
\coordinate (-south) at ({.5\solutelength},0);
\coordinate (-south west) at (0,0);
\coordinate (-south east) at (\solutelength,0);
\coordinate (-north west) at (0,\soluteheight);
\coordinate (-north east) at (\solutelength,\soluteheight);
\coordinate (-south west reduced) at ({0+\solutevariabilitylow},0);
\coordinate (-south east reduced) at ({\solutelength-\solutevariabilityhigh},0);
\coordinate (-north west reduced) at ({0+\solutevariabilitylow},\soluteheight);
\coordinate (-north east reduced) at ({\solutelength-\solutevariabilityhigh},\soluteheight);
\ifx\stylelow\hasfading
\fill (-south west reduced) -- (-south) -- (-north) -- (-north west reduced) -- cycle;
\fill[left color=.!0, right color=.] (-south west) -- (-south west reduced) -- (-north west reduced) -- (-north west) -- cycle;
\else
\fill (-south west reduced) -- (-south) -- (-north) -- (-north west) -- cycle;
\fi
\ifx\stylehigh\hasfading
\fill (-south) -- (-south east reduced) -- (-north east reduced) -- (-north) -- cycle;
\fill[left color=., right color=.!0] (-south east reduced) -- (-south east) -- (-north east) -- (-north east reduced) -- cycle;
\else
\fill (-south) -- (-south east reduced) -- (-north east) -- (-north) -- cycle;
\fi
\node[text=\solutelabelcolor] (-label) at ($(-south west) !0.5! (-north east)$) {\tikzpictext\strut};
},
},
solute/length/.code={
\def\solutelength{#1}
},
solute/height/.code={
\def\soluteheight{#1}
},
solute/variability high/.code={
\def\solutevariabilityhigh{#1}
},
solute/variability low/.code={
\def\solutevariabilitylow{#1}
},
solute/label color/.code={
\def\solutelabelcolor{#1}
},
solute/label/.style={
pic text={#1}
},
}
% the interface
% 1 - low concentration
% 2 - somewhat arbitrary, vertical positioning, user has to manage these manually
% 3 - color
% 4 - length (equal to abs max concentration - absolute min concentration)
\begin{document}
\begin{tikzpicture}
\draw[-stealth, thick] (0,0) -- (11,0);
\foreach \x in {0,...,10} {
\draw (\x,.1) -- ++(0,-.2);
}
\draw (0,.2) pic[yellow, solute/length=6, solute/label={a}] {solute};
\draw (1,-.7) pic[cyan, solute/length=5, solute/label={b}] {solute};
\end{tikzpicture}
\end{document}
The x-axis will span from 1 nM to 100 mM (8 or so orders of magnitude). The following tickmarks will be present and will have labels represented 1 nM (1e-9 of the common unit of M), 1 {\mu}M (1e-6 of the common unit of M), 1 mM (1e-3 of the common unit of M), and 100 mM (1e-1 of the common unit of M). Other tickmarks can be drawn - can be decided based on defaults and aesthetics.
The user will provide values corresponding to either nM or M, whichever is most numerically convenient for the compiler.
The question is, how best to adapt the MWE to include the following:
\begin{axis}[
xmode=log,
xmin=1e-9, xmax=1e-1,
axis x line=bottom,% only show the bottom x axis
hide y axis,
ymin=0,ymax=5]
% calls to various nodes placed here.
end{axis}
as well as, handling values as arguments to which explicit and meaningful engineering units are associated.
