MathGroup Archive 2000

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

Search the Archive

Re: ContourPlots,DensityPlots

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23591] Re: [mg23558] ContourPlots,DensityPlots
  • From: BobHanlon at aol.com
  • Date: Sun, 21 May 2000 18:12:57 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 5/20/2000 3:40:17 AM, hokepaul at pilot.msu.edu writes:

>I have a matrix of data I want to plot and show for a presentation.
>
>The problems I am having are as follows
>
>with ColorFunctionScaling->True, It doesn't seem that the colors have 
>any thing to do with the actual values if I use a legend and use 
>ColorFunction->Hue, the scale is on the plot doesn't equal the legend 
>since the data is truncated to fit 0-1.
>
>I'm trying to divide by the largest value since all my data is positive
>
>and then the legend color scheme should fit the data plot except I don't
>
>have a zero in my data to peg the lower end.  I hate to add a zero in my
>
>matrix just to fix the lower end of the color scheme, is that the only
>
>option?
>
>I can delineate which contours I want, but I can't label them.  Is there
>
>anyway to print the value of contours?  That is on the plot have each 
>contour marked so that it isn't just a bunch of lines? 
>

Needs["Graphics`Legend`"]

data = Table[
      10.*Sin[x + y]Cos[x - y], {x, xmin = -Pi, xmax = Pi, Pi/24.}, {y, 
        ymin = -Pi, ymax = Pi, Pi/24.}];

Plot3D[10Sin[x + y]Cos[x - y], {x, xmin, xmax}, {y, ymin, ymax}, 
    PlotPoints -> 25];

ShowLegend[
    ListContourPlot[data, ColorFunction -> Hue, Contours -> 12, 
      ContourLines -> False, DisplayFunction -> Identity], {Hue[1 - #] &, 11, 
      ToString[Max[data]], ToString[Min[data]], 
      LegendPosition -> {1.1, -.4}}];

ShowLegend[
    ListDensityPlot[data, ColorFunction -> Hue, Mesh -> False, 
      DisplayFunction -> Identity], {Hue[1 - #] &, 11, ToString[Max[data]], 
      ToString[Min[data]], LegendPosition -> {1.1, -.4}}];


Bob

BobHanlon at aol.com


  • Prev by Date: Re: Question on version 4 and long Pi calculations.....
  • Next by Date: Re: The 'Solving a Block Diagram in Mathematica' web page
  • Previous by thread: ContourPlots,DensityPlots
  • Next by thread: Re: ContourPlots,DensityPlots