Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mathematica ColorFunctionScaling

I have a ListDensityPlot of a temperature in a can in Mathematica. I am animating its development over time, but the ColorFunction always sets the highest temperature of the current step to correspond to Red. I want my max temperature overall to correspond to red, how do I do that (I assume it's got something to do with ColorFunctionScaling)?

Here's my code

Animate[ListDensityPlot[Dev[[m, All, All]], 
  ColorFunction -> (ColorData["TemperatureMap"])], {m, 1, t, 1}, 
 AnimationRunning -> False]
like image 318
user998253 Avatar asked Oct 17 '11 14:10

user998253


1 Answers

Set ColorFunctionScaling -> False and manually scale the color function, using something like

ColorFunction -> (ColorData["TemperatureMap"][Rescale[#, {min, max}, {0,1}]&)

where min and max are the overall minimum and maximum (probably Through[{Min,Max}[Dev]].)

like image 139
Brett Champion Avatar answered Oct 18 '22 16:10

Brett Champion