I am trying to generate a blue-cyan-green-yellow-red color gradient that is linear in Hue. The code
ContourPlot[x, {x, 0, 1}, {y, 0, 1}, ContourStyle -> None,
ColorFunction -> Function[{x, y}, Hue[2/3*(1 - x)]],
ColorFunctionScaling -> False, AspectRatio -> 0.125,
ImageSize -> 840]
gives
(source: ucdavis.edu)
which seems okay. However, adding the option Contours -> 500
to the above, i.e., evaluating
ContourPlot[x, {x, 0, 1}, {y, 0, 1}, Contours -> 500,
ContourStyle -> None,
ColorFunction -> Function[{x, y}, Hue[2/3*(1 - x)]],
ColorFunctionScaling -> False, AspectRatio -> 0.125,
ImageSize -> 840]
produces
(source: ucdavis.edu)
By trying different numbers for Contours, I can reduce the odd artifact at the red end of this gradient. But I suspect I am missing something. Any suggestions? Thanks a lot.
ColorFunction
, but with whatever internal function decides on the contour levels. Just look at the output fromContourPlot[x, {x, 0, 1}, {y, 0, 1}, Contours -> 60]
.... $\endgroup$Contours -> Subdivide[500]
$\endgroup$(1.0/61 Range[60])
whenContours -> 60
is chosen. But instead, the contours correspond toRound[1/61, .001] Range[60]
...... Bug report filed $\endgroup$