I'd like a smooth 1d mesh, line the black curve, but coloured. All I'm able to get is the collection of rectangles shown in the figure below…
\documentclass{standalone}
\usepackage{pgfplots}\pgfplotsset{compat=newest}
\begin{document}\begin{tikzpicture}\begin{axis}
\addplot [mesh,line width=20pt,domain=-1:1,samples=101] {sin(360*x)*x};
\addplot [no marks,line width=20pt,domain=-1:1,samples=101] {sin(360*x)*x-1};
\end{axis}\end{tikzpicture}\end{document}