Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: ListPlot3D
Replies: 2   Last Post: Jun 17, 2013 6:15 AM

 Messages: [ Previous | Next ]
 Bill Rowe Posts: 1,647 Registered: 3/14/08
Re: ListPlot3D
Posted: Jun 17, 2013 6:15 AM

On 6/16/13 at 5:15 AM, Anthony.J.Mannucci@jpl.nasa.gov (amannucci)
wrote:

>I could use some help with ListPlot3D. These are examples from the
>documentation. My preconceived notion of what this should do is
>place a data point at coordinates {x,y,z} and connect a surface
>along the z_i. Here is an example from the Mathematica
>documentation:

>ListPlot3D[{{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}},
>Mesh -> All]

>I cannot figure out how to read these data. What are the x,y values?

ListPlot3D works in the same manner as ListPlot. When you do

ListPlot[{2,4,6,3}]

You are supplying a list of y-coordinates with implied
x-coordinates running from 1 to 4. So, the first point is
plotted at (1,2), the second at (2,4) and so on.

Likewise, ListPlot3D takes an array of z-valus with implied
values for both the x and y coordinates. The first row has an x
coordinate of 1 with y coordinates running from 1 to 4. The next
row has an x coordinate of 2 with y coordinates running from 1
to 4 and so on.

To see this look at

ListPlot3D[{{5, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}},
Mesh -> All]

and

ListPlot3D[{{1, 5, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}},
Mesh -> All]

and notice where the peak appears in the resulting plot.

>when I feed in the following data set, the graph is completely blank:

>{{0., 0., 0.}, {0.1, 0.1, 0.248514}, {0.2, 0.2, 0.329812}, {0.3, 0.3,
>0.324989}, {0.4, 0.4, 0.275382}, {0.5, 0.5, 0.207606}, {0.6, 0.6,
>0.138975}, {0.7, 0.7, 0.0799098}, {0.8, 0.8, 0.0358315}, {0.9, 0.9,
>0.008981}, {1., 1., 0.}}

With this data set at every point {x, y, z}, the x and y
coordinates are identical. Consequently, it defines a curve in
space not a surface.

>x and y span 0->1. There are z-values, but nothing is plotted. If I manually change the first three data points to be (mimicing the docs):
>{0., 0., 0.}, {1.0, 0.0, 0.248514}, {0., 1., 0.329812}

Right, now you have defined a surface since you have altered the
x,y coordinates so they are not equal everywhere.

Date Subject Author
6/17/13 David Park
6/17/13 Bill Rowe