MathGroup Archive 2004

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

Search the Archive

Re: ListDensityPlot, ColorFunction, and associated confusions

  • To: mathgroup at
  • Subject: [mg49777] Re: [mg49737] ListDensityPlot, ColorFunction, and associated confusions
  • From: "Wolf, Hartmut" <Hartmut.Wolf at>
  • Date: Fri, 30 Jul 2004 06:02:29 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

>-----Original Message-----
>From: AES/newspost [mailto:siegman at]
To: mathgroup at
>Sent: Thursday, July 29, 2004 1:46 PM
>To: mathgroup at
>Subject: [mg49777] [mg49737] ListDensityPlot, ColorFunction, and associated
>I'm trying to show some rectangular arrays in two ways by creating 
>side-by-side ListPlot3D and ListDensityPlot displays in a 
>Each of the arrays contains a primary "mountain peak" that 
>arises out of 
>a flat plane at a base elevation close to zero, plus several secondary 
>hillocks only 1/3 to 1/2 as high as the main peak -- and 
>that's how they 
>show up in the ListPlot3D,
>In the ListDensityPlot, however, using the standard 
>the tops of some of the secondary hillocks show up in the same bright 
>red as the top of the main peak, even though they appear in the 
>ListPlot3D to be less than 1/2 as high as the main peak.  It's as if 
>ColorFunctionScaling is being applied locally to each individual peak 
>What might be going on here?  (And secondarily, because of the way Hue 
>functions, the flat background plain ends up in close to the 
>same red as 
>the top of the peaks.  Any easy way to fix that?)

Well, an example might simplify discussion.  
Possibly your problems are related to: 

 Options[ListPlot3D, PlotRange]
 {PlotRange -> Automatic}

 Options[ListDensityPlot, PlotRange]
 {PlotRange -> Automatic}

Please compare:

 data=Table[ 1/(1+a(x^2+y^2)),{x,-1,1,.1},{y,-1,1,.1}];

 ListDensityPlot[data, ColorFunction -> Hue]


 ListPlot3D[data, PlotRange -> All]
 ListDensityPlot[data, ColorFunction -> Hue, PlotRange -> All]

The bottom and top are both red because Hue[0] == Hue[1] == RGBColor[1,0,0]
If you don't like that, customize your ColorFunction.

Hartmut Wolf

  • Prev by Date: Re: Why overloaded arithmetic operations are so slow?
  • Next by Date: Re: Speed of repeated matrix calculation
  • Previous by thread: Re: ListDensityPlot, ColorFunction, and associated confusions
  • Next by thread: Marking a (rectangular) zone in a standard 2D plot using "Rectangle"