I would like to define horizontal shading, that could be stretched depending on needs. What I did to far is this
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\pgfdeclarehorizontalshading{pressure}{1cm}{color(0cm)=(black!30); color(1cm)=(black!50); color(3cm)=(black!10); color(4cm)=(black!30)}
\shade[shading=pressure] (0,0) rectangle (10cm,2cm);
\end{tikzpicture}
\end{document}
but it just does not work. Why?
EDIT: This is not about fancy background. I have to present the changes in pressure in the air and I do not have exact measures of the rectangle. Had I knew exact measures of the rectangle (\leng), I could use 0.25*\leng, 0.75*\leng and \leng



\pgfuseshading{pressure}. – Peter Grill Dec 18 '14 at 16:13