MathGroup Archive 2000

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

Search the Archive

Re:(List)DensityPlot and coloring...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25897] Re:[mg25779] (List)DensityPlot and coloring...
  • From: Adalbert Hanssen <hanssen at Zeiss.de>
  • Date: Tue, 7 Nov 2000 02:56:05 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi, MathGroup,

this is a function to color DensityPlot, ListDensityPlot and the
like in rainbow-like colors:

Bunt[i_]:=			(* the argument ranges from 0 to 1 *)
Module[{r1=.40,r2=.8,g1=.45,g2=.75,b1=.15,b2=.65}
      ,Which[i<0,  RGBColor[0, 0,.3]	(* 0,0,.55 *)
            ,i>1,  RGBColor[1,.4,.4]	(* 1,0,0   *)
            ,i===Indeterminate, RGBColor[0,0,0]
            ,True, RGBColor[If[i<r1,0,If[i<r2,(i-r1)/(r2-r1),1]]
	                       ,.9*If[i<g1,i/g1,If[i>g2,1-(i-g2)/(1-g2),1]]
	                       ,If[i<b1,3i+1-3b1,If[i<b2,(i-b2)/(b1-b2),0]]
	                       ]
            ]
      ];			(* Bunt *)


An application example for Bunt would be


f[x_,y_]:=x*y;
DensityPlot[f[x,y],{x,0,10},{y,0,10},ColorFunction->Bunt]


kind regards

Dipl.-Math. Adalbert Hanszen


  • Prev by Date: Differentiation of Spline Fits
  • Next by Date: Re: recursion
  • Previous by thread: Differentiation of Spline Fits
  • Next by thread: Simultaneous Equation Estimation (SUR,2SLS,3SLS)?