MathGroup Archive 2001

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

Search the Archive

Re: ListPlot vs ListPlot3D

  • To: mathgroup at
  • Subject: [mg28906] Re: ListPlot vs ListPlot3D
  • From: "Allan Hayes" <hay at>
  • Date: Fri, 18 May 2001 01:13:09 -0400 (EDT)
  • References: <9e02ft$>
  • Sender: owner-wri-mathgroup at


The options MeshRange works if the array is evenly spaced.

data= Table[{x,y,x^2+y^2},{x,-4,4},{y,-5,7}];

Extract array of z values

dataz =data/.{__,z_?NumberQ}->z

Get the x and y ranges


Use ListPlot3D with MeshRange ->mr;

ListPlot3D[dataz, MeshRange->mr];

If we have an uneven rectangular grid we can make an interpolation function
for data and plot that: for example




If the points are not on a rectangular grid then the function
from the standard add-on
can be used.

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Otto Linsuain" <linsuain+ at> wrote in message
news:9e02ft$2vu at
> Dear Mathematica experts, I was wondering if there is a way of plotting
> a 3D graph using a rectangular array of z-values USING THE CORRESPONDING
> Here is what I mean:
> with a 2D plot, one can do:
> ListPlot[ {y1,y2,y3,.........yn} ]  and this will give a graph of the
> {y1,1} ,{y2,2}, {y3,3},....{yn,n}, i.e. it will use the integers
> 1,2,3,...n as the x values.
> One can, however, write
> ListPlot[ { {x1,y1}, {x2,y2}, {x3,y3}, ... {xn,yn} }]
> and get a graph with user-specified values for x and y.
> There doesn't seem to be an analogous thing for ListPlot3D. The values
> of x and y seem to be always {1,1}, {1,2},{2,1},{2,2},.......{n,n}
> Any ideas? Thanks in advance. Otto Linsuain.

  • Prev by Date: Re: Q: Recursion on a list
  • Next by Date: RE: array generated
  • Previous by thread: Re: ListPlot vs ListPlot3D
  • Next by thread: Re: ListPlot vs ListPlot3D