MathGroup Archive 1998

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

Search the Archive

Re: ListContourPlot with (x,y,z) values




Joel Cannon wrote in message <6kajtj$2cb@smc.vnet.net>...
>Can anyone point me to a source for a package or show me how to modify
>ListContourPlot so that I can use (x,y,z) values. The standard package
>takes an array of z values leaving me or someone else to translate the
>matrix indices into x and y coordinates.

Joel,
You will need to extract the z coordinates for ContourListPlot and
extract the min and max of the x and y coordinates to put into the
option MeshRange -> {{xmin,xmax},{ymin,ymax}}

Example

xyztable=Table[{x,y, y}, {x,.5,4,.5},{y,0.0,3,.5}];

ztable= Map[#[[3]]&, xyztable,{2}];
xtable= Map[#[[1]]&, xyztable,{2}];
ytable= Map[#[[2]]&, xyztable,{2}];

xrange = Through[{Min,Max}[xtable]]; yrange =
Through[{Min,Max}[ytable]];

ListContourPlot[ztable, MeshRange -> {xrange, yrange},
 FrameLabel -> {"y", "x"}];

Note that the axes are not as might be expected from ContourPlot[y,
{x,.5,4},{y,0.0,3}];

We can transpose ztable and interchange the labels to get this form.
------------------------------------------------------------- Allan
Hayes
Training and Consulting
Leicester UK
http://www.haystack.demon.co.uk
hay@haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44(0)116 271 8642





  • Prev by Date: Re: red-green stereograms
  • Next by Date: Problem with Mathematica 2.2 reinstall on W95 machine
  • Prev by thread: ListContourPlot with (x,y,z) values
  • Next by thread: Newbe: Wave equation