I have a list of values of the form {{a_1,b_1,c_1},{a_2,b_2,c_2}...} where a goes from 0 to 30, b goes from 0 to 30, and c goes from 0 to .05. For some reason, when I plot this using ListPlot3D I get ranges of 1 to 4, 0 to 40, and 0 to 500 respectively (the number of data points that I am plotting.

The exact command that I am using is: ListPlot3D[data,PlotRange->{Full,Full,Full},AxesLabel->{"Length","Distance","Time"}]

Does anyone know what might be the issue?

Note: If anyone wants to look at the actual data, I posted it here.

  • 1
    $\begingroup$ In your data you give four elements $\{\{a_1,b_1,c_1,d_1\},...\}$ what's the last one for? $\endgroup$ – Spawn1701D Apr 29 '13 at 8:10
  • 1
    $\begingroup$ You can get only the first three using data[[All, 1 ;; 3]] $\endgroup$ – PlatoManiac Apr 29 '13 at 8:12
  • $\begingroup$ @Spawn1701D wow, not sure how I missed that $\endgroup$ – soandos Apr 29 '13 at 8:18
  • $\begingroup$ @PlatoManiac fixed it. Do you mind explaining why I got the behavior that I did in an answer? $\endgroup$ – soandos Apr 29 '13 at 8:20
  • $\begingroup$ @soandos if you check the manual you will see that you gave him to make the 3D plot of an array of height values. $\endgroup$ – Spawn1701D Apr 29 '13 at 8:26

Do you mind explaining why I got the behavior that I did in an answer?

There is more than one input syntax for ListPlot3D:

enter image description here

When you use data of the form {{_, _, _, _} ..} the last definition is used.

For example, with:

dat = Table[{x + Cos[x], x + Sin[x], Sqrt[x], x}, {x, 0, 30, 0.1}];

Of which the ranges are:

{Min@#, Max@#} & /@ Transpose[dat]
{{1., 30.1543}, {0., 29.012}, {0., 5.47723}, {0., 30.}}

You will get a plot like:

enter image description here

This is displaying the values (axis 0,10,20,30) for each column (axis 1,2,3,4) over the {x, 0, 30, 0.1} slices (axis 0,100,200,300).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.