MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

DensityPlot colours misbehaving

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78705] DensityPlot colours misbehaving
  • From: "Tim Birks" <pystab at hotmail.com>
  • Date: Sat, 7 Jul 2007 06:05:16 -0400 (EDT)
  • Organization: School of Physics, University of Bath, UK

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.

T.




  • Prev by Date: Re: Substituting simpler expressions
  • Next by Date: LocatorPane: turn off "direct any click to nearest locator"?
  • Previous by thread: Re: a special type of strings!
  • Next by thread: Re: DensityPlot colours misbehaving