Re: DensityPlot colours misbehaving
- To: mathgroup at smc.vnet.net
- Subject: [mg78737] Re: [mg78705] DensityPlot colours misbehaving
- From: Brett Champion <brettc at wolfram.com>
- Date: Sun, 8 Jul 2007 06:08:58 -0400 (EDT)
- References: <200707071005.GAA05698@smc.vnet.net>
On Jul 7, 2007, at 5:05 AM , Tim Birks wrote: > > I have Mathematica v6 and am running code that worked fine with v5. > OS is > Windows XP. Here's a particularly annoying unexplained difference > between > the two versions. > > DensityPlot[Exp[-x], {x, 0., 4.}, {y, 0., 4.}, ColorFunctionScaling -> > False] > > behaves as expected, giving a nice gradual horizontal grading of > colour from > white on the left to blue/violet on the right. > > In contrast, > > DensityPlot[Exp[-x - y], {x, 0., 4.}, {y, 0., 4.}, > ColorFunctionScaling -> > False] > > which should give a similar grading from lower-left to upper-right, > instead > gives a mostly blue/violet field with a pure white triangular wedge > in the > lower-left corner. The discontinuous jump between the two occurs > roughly > where x+y=1.4. > > Re-plotting with x and y running from 0 to 2 instead of 4 makes the > white > triangle appear smaller rather than bigger. Note the setting of > ColorFunctionScaling means that the colour at a particular point (x,y) > shouldn't depend on what's happening elsewhere; also note that the > functions > plotted are very simple, well-behaved and evaluate to between 0 and > 1 in the > ranges plotted. > > Can anyone please explain what is happening, how it can be fixed, > and why it > is not a bug? > > Apologies if this has been asked before. I have searched the posts > available > on my news reader and found nothing relevant. The triangle at the bottom is being clipped by the automatic PlotRange calculation. Compare: DensityPlot[Exp[-x - y], {x, 0., 4.}, {y, 0., 4.}] DensityPlot[Exp[-x - y], {x, 0., 4.}, {y, 0., 4.}, ClippingStyle- >Automatic] DensityPlot[Exp[-x - y], {x, 0., 4.}, {y, 0., 4.}, PlotRange->All] Brett Champion Wolfram Research
- References:
- DensityPlot colours misbehaving
- From: "Tim Birks" <pystab@hotmail.com>
- DensityPlot colours misbehaving