How can I define a ColorFunction
for my ContourPlot
using Piecewise
? For example, after making a ContourPlot
for this function:
p[x_, y_] := 1 - Sin[x]^2 Sin[y]^2;
I want to define my ColorFunction
in a way that for example for 0 < p < 0.1
the plot have a different color than 0.1 < p < 0.2
. An example of what I need is in the following plot:
where the colorbar at the right shows that each color corresponds to a value of p
.
ContourPlot[1 - Sin[x]^2*Sin[y]^2, {x, 0, Pi}, {y, 0, Pi}, PlotLegends -> Automatic, ColorFunction -> "DarkRainbow"]
$\endgroup$ – Vitaliy Kaurov Mar 25 '13 at 23:000.8<p<0.9
.ColorFunction -> "DarkRainbow"
doesn't give me this option. $\endgroup$ – ZKT Mar 25 '13 at 23:03