11
$\begingroup$

I have some data representing a nested list, each element being composed of 3 real numbers like {{652.112, 0, 0.111838}, {664.096, 29.134, 0.0000485323}, {713.531, 12.1382, 0.805022} ...}. I would like to make an illustration for a journal article out of this list. The first idea is to use ListPlot3D function. The points in my list span in space from 600 to 1300 along $x$ (e.g. about 700 units along $x$) and from -100 to 100 along $y$ (e.g. about 200 units along $y$).

It is principally important for me that the illustration gives a correct feeling about the $x/y$ ratio. However, when I build it the image looks about equal along $x$ and along $y$. Changing AspectRatio->0.2 to 0.5 only helps partially, but disturbs another aspects of the image.

Is there a way to control the $x\text{–}y$ aspect ratio of a 3D image?

$\endgroup$
2
  • $\begingroup$ Did you try BoxRatios? "BoxRatios->Automatic normally gives box ratios corresponding to the actual coordinate values in the 3D graphic." ~ Documentation Link: bit.ly/MKkJQp $\endgroup$ Aug 7, 2012 at 9:22
  • $\begingroup$ Thank you. I did not yet. This solves my question. Best, Alexei $\endgroup$ Aug 7, 2012 at 9:41

2 Answers 2

10
$\begingroup$

You need BoxRatios, it works also in ListPlot3D.

GraphicsRow[ Table[ Graphics3D[ Sphere[], BoxRatios -> a],
                    {a, {{1, 1, 1}, {2, 1, 1}, {1, 2, 1}, {1, 1, 2}}}]]

enter image description here

You can use it in ListPlot3D, e.g.

GraphicsRow[ Table[ ListPlot3D[Table[Sin[x y], {x, 0, 3, 0.1}, {y, 0, 3, 0.1}], 
                                                       BoxRatios -> {1, 1, 1/k}],                 
                   {k, 3}] ]

enter image description here

$\endgroup$
9
$\begingroup$

Maybe something like this:

data = Transpose[{RandomReal[{600, 1300}, 100], 
    RandomReal[{-100, 100}, 100], RandomReal[{0, 1}, 100]}];

ListPlot3D[data, BoxRatios -> {700, 200, 100}]

enter image description here

Even better if you use:

ListPlot3D[data, BoxRatios -> {Automatic, Automatic, 100}]

In this way you control just the height of the box to find your ideal figure.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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