For comparison, here is an approach using Metapost. I'm showing two different palettes: standard HSV colours and one of the colour ranges defined in Colorbrewer. In both cases I am "cheating" by drawing the line as a series of dots (but this is essentially what all the other tools are doing, they just hide it from the user).

You need to compile this with lualatex. Follow the link at the top for tutorials and reference material about Metapost.
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
vardef hsv_color(expr h, s, v) =
save chroma, hh, x, m;
chroma = v * s;
hh = h / 60;
x = chroma * (1 - abs(hh mod 2 - 1));
m = v - chroma;
if hh < 1: (chroma,x,0)+(m,m,m)
elseif hh < 2: (x,chroma,0)+(m,m,m)
elseif hh < 3: (0,chroma,x)+(m,m,m)
elseif hh < 4: (0,x,chroma)+(m,m,m)
elseif hh < 5: (x,0,chroma)+(m,m,m)
else: (chroma,0,x)+(m,m,m)
fi
enddef;
beginfig(1);
numeric u, v;
u = 2v = 25;
path xx, yy;
xx = (left--right) scaled 3u;
yy = origin -- up scaled 9v;
numeric s; s = 1/8;
path ff;
ff = (-3,9) for x = s-3 step s until 3: -- (x, x*x) endfor;
ff := ff xscaled u yscaled v;
for t = 0 step 1/8 until arclength ff:
pair w; w = point arctime t of ff of ff;
draw w withcolor hsv_color(30(9 - ypart w / v),2,1);
endfor
path gg;
gg = (-2,0.5) .. controls (0,-1) and (0,7) .. (1,7.8) .. controls (2,1) and (2,4) .. (3,3);
gg := gg xscaled u yscaled v;
input colorbrewer-rgb
for t = 0 step 1/8 until arclength gg:
pair w; w = point arctime t of gg of gg;
numeric p, q;
p = 8 - ypart w / v;
q = floor p;
draw w withcolor (p-q)[PiYG[9][q+1], PiYG[9][q+2]];
endfor
ahangle := 20;
drawoptions(withcolor 1/2);
drawdblarrow xx scaled 1.2;
drawarrow yy scaled 1.1;
for x = -3,-2,-1,1,2,3:
draw (down--up) scaled 2 shifted (x*u,0);
label.bot("$" & decimal x & "$", (x*u, -2));
endfor
for y = 2, 4, 6, 8:
draw (left--right) scaled 2 shifted (0, y*v);
label.lft("$" & decimal y & "$", (-2, y*v));
endfor
drawoptions();
endfig;
\end{mplibcode}
\end{document}