Does there exist any command to make the bar color depend on the bar size ?
For example, the color of a bar of size x (between 0 and 100) should be filled of x percent of black, as displayed below.
The aim is to be able to import data from a table and let LaTeX choose the color automatically.
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xbar, xmin=0,
width=12cm, height=5cm, enlarge y limits=0.5,
xlabel={\#participants},
symbolic y coords={maybe,no,yes},
ytick=data,
nodes near coords, nodes near coords align={horizontal},
]
\addplot coordinates {(30,no) (40,yes) (80,maybe) };
\end{axis}
\end{tikzpicture}
\end{document}