Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

contouring

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87198] contouring
  • From: Claus <clausenator at gmail.com>
  • Date: Fri, 4 Apr 2008 02:55:37 -0500 (EST)
  • Organization: Comp.Center (RUS), U of Stuttgart, FRG

Hello,
thanks everybody for your help so far!
It's been a blast dwelving into Mathematica, and I am fairly impressed 
how nice it is to work without loops! ;-)

Now I've got some plotting issues.
In the example below, specifically for the ListContourPlot:
a) can I invert the colors (so for the case of Lake colors that deep 
blue is at the 50-value?
b) can I change the contouring so that the the square with the corners 
{0,1},{1,0} is contoured?

XYZDATA = {{0.9, 0.9, 50}, {0.8, 0.9, 30}, {0.9, 0.8, 30}, {0.5, 0.5,
    15}, {0.2, 0.1, 1}, {0.1, 0.2, 1}}

ListPlot[Transpose[{XYZDATA[[All, 1]], XYZDATA[[All, 2]]}]
  , PlotRange -> {{0, 1}, {0, 1}}
  , AspectRatio -> 1]

ListContourPlot[XYZDATA
  , AspectRatio -> 1
  , PlotRange -> {{0, 1}, {0, 1}}
  , ColorFunction -> "LakeColors"]

It seems as if things get worse if there are more extreme values, like this:

XYZDATA2 = {{0.95, 0.95, 150}, {0.9, 0.9, 50}, {0.8, 0.9, 30}, {0.9,
    0.8, 30}, {0.5, 0.5, 15}, {0.2, 0.1, 1}, {0.1, 0.2, 1}}

Dots = ListPlot[Transpose[{XYZDATA2[[All, 1]], XYZDATA2[[All, 2]]}]
   , PlotRange -> {{0, 1}, {0, 1}}
   , AspectRatio -> 1]

ShadedPlot = ListContourPlot[XYZDATA2
   , AspectRatio -> 1
   , PlotRange -> {{0, 1}, {0, 1}}
   , ColorFunction -> "LakeColors"]

Show[Dots, ShadedPlot]

In the second case, the interpolation does not extent to the point at 
{0.95, 0.95}.
Is there a way to set somehow limits for contouring, for the given 
example, say all z-values >50 should be contoured with the darkest shade 
of blue?

I played around with creating a ColorScheme, like
GreyColor[ z_ ] := GrayLevel[1 - z]
and
ShadedPlot2 = ListContourPlot[XYZDATA2
   , AspectRatio -> 1
   , PlotRange -> {{0, 1}, {0, 1}}
   , ColorFunction -> GreyColor
   ]
which sort of solves my problems, because now all z-values >1 are black, 
which I verified by this code

MaxCont = 1;
MinCont = 0.1;
DeltaCont = 0.1;
Graphics[{
   Table[{
     GreyColor[i]
     , Rectangle[{i - DeltaCont, DeltaCont}, {i, 2*DeltaCont}]
     , Black,
     Text[Style[i, 20], {i - (DeltaCont/3), MinCont}, {i,
       1.5*MaxCont}]
     }, {i, MinCont, MaxCont, DeltaCont}]
   }]

However, the point at {0.95, 0.95} is still not included in the shading. 
So I guess my questions a) and b) from above are still my problems... ;-)
Thanks again for any hints!
Cheers,
Claus


  • Prev by Date: Re: The FinancialData Function
  • Next by Date: Re: What is @@@?
  • Previous by thread: Re: Re: Label vertices in Graph to display with GraphPlot
  • Next by thread: Re: contouring