Re: ColorFunction
- To: mathgroup at smc.vnet.net
- Subject: [mg27775] Re: [mg27730] ColorFunction
- From: "Mark Harder" <harderm at ucs.orst.edu>
- Date: Wed, 14 Mar 2001 04:07:31 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Michael, My approach was to scale the color function to the maximum contour level. In order for this to take effect, one has to turn off the scaling that the ContourPlot function does automatically (ColorFunctionScaling -> False) . I also defined my own templin function, adding an amplitude argument so it can be rescaled easily : In[328]:=templim[A_, r_, z_] := A Sin[r] Cos[.3 z]; In[329]:=ctr = Table[x, {x, 0., 1500., 100.}] Out[329]= {0., 100., 200., 300., 400., 500., 600., 700., 800., 900., 1000., 1100., \ 1200., 1300., 1400., 1500.} In[330]:=colFn = Hue[.7 (1 - .79 (#/Max[ctr]) ) ] & In[332]:= A = 1000.; ContourPlot[templim[A, r, z], {r, 0, 2}, {z, 0, 4}, PlotRange -> All, ColorFunctionScaling -> False, ColorFunction -> colFn, PlotPoints -> 150, AspectRatio -> 1/2, Contours -> ctr] (*graphics here*) Here's your example, with my templin: A=1000.; ContourPlot[templim[A, r, z], {r, 0, 2}, {z, 0, 4}, PlotRange -> All, ColorFunction -> (Hue[0.7(1 - 0.79*#)] &), PlotPoints -> 150, AspectRatio -> 1/2, Contours -> {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500}] (*graphics here*) As you can see, when the maximum amplitude of the function is < max. of the contours, only the hues up through the green are used with my version, whereas the example you sent resacales the hues to go through the yellow. -mark harder -----Original Message----- From: Michael Wild <wild at ilt.fhg.de> To: mathgroup at smc.vnet.net Subject: [mg27775] [mg27730] ColorFunction >Dear Colleagues, >I am trying to display a r-z-temperature field with ContourPlot. >How can I modify the ColorFunction command such that the >temperature range from >100-200 K >200-300 K >etc. is displayed in the same color no matter if the total >temperature range of the plot is 0 to 500 K or >0 to 1000 K. >My current plot command is >ContourPlot[templim[r, z], {r, 0, 2}, {z, 0, 4}, PlotRange -> All, > ColorFunction -> (Hue[0.7(1 - 0.79*#)] &), > PlotPoints -> 150, AspectRatio -> 1/2, > Contours -> {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, >1200, > 1300, 1400, 1500}] >Your help is very much appreciated >thanks >Michael > > >