ColorFunction question - DensityPlot and ContourPlot difference
- To: mathgroup at smc.vnet.net
- Subject: [mg85036] ColorFunction question - DensityPlot and ContourPlot difference
- From: "Maarten van der Burgt" <maarten.vanderburgt at icos.be>
- Date: Thu, 24 Jan 2008 04:51:20 -0500 (EST)
Dear all,
I am having some trouble with the colors in DensityPlot.
In pl1 below the colors change nicely from blue to red.
As ColorFunctionScaling is true I would expect in pl2 the blue to
correspond to -5, and the red to +5, as -5 and +5 are the limits of the
PlotRange. The colors in the plot would then vary between light blue and
light yellow. But this is not the case: pl1 is identical to pl2.
pl1 = DensityPlot[Sin[x] Sin[y],{x,-4,4},{y,
-3,3},ColorFunction->"TemperatureMap"]
pl2 = DensityPlot[Sin[x] Sin[y],{x,-4,4},{y,-3,3},PlotRange->
{-5,5},ColorFunction->"TemperatureMap"]
Using ContourPlot instead I do get the expected behaviour.
pl3= ContourPlot[Sin[x] Sin[y],{x,-4,4},{y,
-3,3},ColorFunction->"TemperatureMap",Contours->100,ContourStyle->None]
pl4= ContourPlot[Sin[x] Sin[y],{x,-4,4},{y,-3,3},PlotRange->
{-5,5},ColorFunction->"TemperatureMap",Contours->100,ContourStyle->None]
I am a bit puzzled. I would expect to read a bit on this subtle difference
in the Density and Contour Plots tutorial (paste
'tutorial/DensityAndContourPlots' in the Documetation Centre), but this is
not the case.
Can someone help me to explain this?
Thanks,
Maarten