# ListContourPlot-ColorFunction

How can I use ONLY the central 90% of the spectrum, not the whole range? For example, I do not like to see the lowest values in purple, but in deep blue color.

tzvw={{394.5, 0.58, -0.56391}, {394.5, 0.56, -0.580086}, {394.5,
0.54, -0.56415}, {394.5, 0.52, -0.561491}, {394.5,
0.5, -0.572876}, <<3267>>, {90557.4, 0.1, -0.358004}, {90557.4,
0.08, -0.2929}, {90557.4, 0.06, -0.240185}, {90557.4,
0.04, -0.211586}, {90557.4, 0.02, -0.156428}}

ShowLegend[
ListContourPlot[tzvw,
ColorFunction -> ColorData["Rainbow"],
Contours -> Range[-2.25, 2.75, 0.25], ContourLines -> False,
FrameTicks -> {ticklst, Automatic, None, None},
PlotRange -> {Automatic, {0, 0.52}, {-2.25, 2.75}}, FrameStyle -> 20,
AspectRatio -> 0.3, ImageSize -> 700,
"DelaunayDomainScaling" -> True,
RegionFunction -> Function[{x, y, z}, y <= 0.5]]

• This is not valid code. Please post code that can be evaluated and results in useful output (e.g. define tzvw). Apr 20, 2012 at 9:15

You can Rescale your points that are passed to ColorFunction so that they're between 0.05 and 0.95 as in the example below:

data = Table[Sin[i + j^2], {i, 0, 3, 0.1}, {j, 0, 3, 0.1}];
ListContourPlot[data, ColorFunction -> (ColorData["Rainbow"][
Rescale[#, {0, 1}, {0.05, 0.95}]] &)]


• beat me by 20 seconds. BTW, the default setting for ColorFunctionScaling is True, so you should use Rescale[#, {0, 1}, {0.05, 0.95}] (or set ColorFunctionScaling -> False). Apr 20, 2012 at 9:23
• @Heike Thanks, I knew I had forgotten something :)
– rm -rf
Apr 20, 2012 at 9:26
• Looks fine in the first glance but the result is more or less monochrome!
– K-1
Apr 20, 2012 at 9:37
• Thanks R.M but how can I send you the whole tzvw. Then you can see what happens if I apply your approach.
– K-1
Apr 20, 2012 at 9:46
• @K-1 You can't send files through this site. You should try and reduce your problem to a simpler sub-problem that can be easily posted in the question. It needn't even be your actual problem as long as it conveys your problem clearly.
– rm -rf
Apr 20, 2012 at 10:41