0
$\begingroup$

Possible Duplicate:
Controlling the 2D $x–y$ aspect ratio of a 3D plot

I am plotting 1000 points in a 3-dimensional cartesian coordinate system, the plotting range for the x, y, z axes is set to {-1,1} respectively.

Mathematica code:

points1 = RandomReal[{-1, 1}, {500, 3}];
points2 = RandomReal[{-1, 1}, {500, 3}];

sphere = Graphics3D[{Opacity[0.1], Sphere[{0, 0, 0}]}];
plot1 = ListPointPlot3D[points1, PlotStyle -> Green];
plot2 = ListPointPlot3D[points2, PlotStyle -> Black];
Show[{plot1, plot2, sphere}, Axes -> False,
     PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, AspectRatio -> Automatic]

plot

Why does Mathematica plots axes of different lengths? Since I have given the same plotting range, I would expect and want to see a cube. How do I achieve this?

$\endgroup$

marked as duplicate by Artes, rm -rf Nov 18 '12 at 16:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    $\begingroup$ Use BoxRatios -> Automatic. $\endgroup$ – J. M. will be back soon Nov 18 '12 at 13:55
  • $\begingroup$ Wonderful! It works. $\endgroup$ – Genti Saliu Nov 18 '12 at 14:18

Browse other questions tagged or ask your own question.