MathGroup Archive 2006

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

Search the Archive

RE: 3D Plot (or ListPlot?) Question

  • To: mathgroup at
  • Subject: [mg67489] RE: [mg67470] 3D Plot (or ListPlot?) Question
  • From: "David Annetts" <davidannetts at>
  • Date: Wed, 28 Jun 2006 03:51:46 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Hi Kassie,

> Hopefully an easy question:
> I have a list with the form {{x,y,z},{x2,y2,z2},....} and I 
> would like to create a 3D plot of this data.  Unfortunately, 
> 3DListPlot likes to automatically assign the x and y 
> coordinates for the plot.  Is there any way I can get it to 
> plot my {x,y,z} data on their respective axes?

You mean ListPlot3D rather than 3DListPlot ....

There are two options.

Firstly, you can use use ListPlot3D _after_ isolating your z-values via

	ListPlot3D[Map[Last, data, {2}]];

However, the axes are wrong so you'll need to adjust these by giving
ListPlot3D a MeshRange.  As an example, after generating some sample data, 

	data = Table[{x, y, x y}, {x, -2, 2, 1/10}, {y, -2, 2, 1/10}]; (*
then *)
	ListPlot3D[Map[Last, data, {2}], MeshRange -> {{-2, 2}, {-2, 2}}];

Another way is not to use ListPlot3D but a function in one of the standard
packages that is designed for data structured such as yours.  After loading
the package, we have

	ListSurfacePlot3D[data, BoxRatios -> {1, 1, .4}, Axes -> True];



  • Prev by Date: Re: 3D Plot (or ListPlot?) Question
  • Next by Date: Re: solving an equation with sums
  • Previous by thread: Re: 3D Plot (or ListPlot?) Question
  • Next by thread: Getting Color *names* as strings?