How to contour shade two specified contours?

I want to have contour shading between two contours specified by two equations like below,

ContourPlot[{Sin[x] Sin[y] == 1/2, Sin[x] Sin[y] == 1/3},
{x, -3, 3}, {y, -3, 3},
ContourShading -> Automatic, ColorFunction -> “Rainbow”]

However, I failed to generate any color between the two contours. How can I do this?

=================

=================

2 Answers
2

=================

You can plot the area using RegionPlot.

Show[ContourPlot[{Sin[x] Sin[y] == 1/2, Sin[x] Sin[y] == 1/3}, {x, -3,3}, {y,
-3, 3}], RegionPlot[{Sin[x] Sin[y] < 1/2 && Sin[x] Sin[y]> 1/3}, {x, -3, 3},
{y, -3, 3}, ColorFunction -> “DarkRainbow”]]]

Try specifying the problem as the contours of a single function, rather than as two separate functions.

ContourPlot[Sin[x] Sin[y],
{x, -3, 3}, {y, -3, 3},
Contours -> {1/2, 1/3},
ContourShading -> {None, Blue},
ColorFunction -> “Rainbow”]

  

 

How my edit is what the OP wanted.
– halirutan
Apr 28 ’15 at 13:39

  

 

Thanks. But if I indeed use two different functions, what I should do?
– lin zhang
Apr 28 ’15 at 13:41