Path with complicated colormap in TikZ

I want to draw a path in tikz whose local color is a function of position. Here are two examples of what I have in mind:

I found the answers from Path following color gradient in TikZ very instructive. However, in the examples the used colormaps are simple gradients. I need to define a more complicated colormap. Is there a simple way to do this? Or are there even pre-defined colormaps? Or should I use pgfplots?

-

pgfplots offers something on these lines. An example from the manual:

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[axis lines=none]
\end{axis}
\end{tikzpicture}
\end{document}


-
This color map is so much simpler than the shown in the question. – OSjerick Dec 11 '13 at 19:42

I was able to produce the figure with the non-trivial colormap by computing the coordinates and colors externally and using the meta point information in pgfplots. Here is the code:

\documentclass[tikz]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{calc}

\pgfplotsset{compat=1.8}

\begin{document}
\begin{tikzpicture}

\begin{scope}[yshift=0cm]
\draw[->, >=latex, color=black, line width=1.0pt, cap=round] (0.00, 0.00) -- (3.5, 0.00);
\draw[->, >=latex, color=black, line width=1.0pt, cap=round] (0.00, -1.00) -- (0.0, 1.00);
\begin{axis}[x=3cm, y=1cm, ticks=none, axis lines=none, colormap/jet, anchor=origin]
\end{axis}
\end{scope}

\begin{scope}[xshift=5.0cm, yshift=0cm]
\draw[->, >=latex, color=black, line width=1.0pt, cap=round] (-1.10, 0.00) -- (1.25, 0.00);
\draw[->, >=latex, color=black, line width=1.0pt, cap=round] (0.00, -1.10) -- (0.0, 1.10);
\begin{axis}[x=0.2cm, y=0.2cm, ticks=none, axis lines=none, colormap/jet, anchor=origin]