Re: want to limit range of shading in contour plot
- To: mathgroup at smc.vnet.net
- Subject: [mg117052] Re: want to limit range of shading in contour plot
- From: Heike Gramberg <heike.gramberg at gmail.com>
- Date: Tue, 8 Mar 2011 05:38:57 -0500 (EST)
You can use the RegionFunction option in ContourPlot for this, i.e.
RegionFunction -> Function[{ss, ww}, -20 <= f[ss, ww] <= -1]
Heike.
On 7 Mar 2011, at 10:48, lala wrote:
>
> I want to plot a contour plot with shading, and my function drops
> quickly negative. However I only specify contours between -20 and -1,
> and I'd like to also restrict the shading to be within that... somehow
> mathematica makes the region outside of that colored for an arbitrary
> range, and I don't know how to get rid of it.
>
> ContourPlot[f[s, w]/, {s, -5, 2}, {w, -3.5, 2},
> Contours -> Table[n, {n, -20, -1}],
> ContourStyle -> {Thickness[0.002]},
> ColorFunction -> (ColorData["BlueGreenYellow"][
> Rescale[#, {-20, 1}]] &), PlotRangePadding -> 0,
> ColorFunctionScaling -> False]
>
> Is there any option in which I can limit the shading to lie within the
> contours specified only?
>