# Same scale for all the axes in Plot3D

I can't find this in the documentation. How do you force the same scale for all the axes when making a 3D plot? There is the BoxRatios option, but this only changes the dimensions of the visible box with no regard to the actual scales of the axis.

• Set that option you just found to Automatic and report back. Commented Jul 3, 2015 at 8:59
• Shouldn't it be BoxRatios -> 1 ? Commented Jul 3, 2015 at 9:14
• @Feyre, you can answer your own question by trying to plot a function like $x^2+y^2$. Note the shape of the box, and then note the numbers on the ticks. Commented Jul 3, 2015 at 9:34
• @Guesswhoitis. yes that worked, thank you. Commented Jul 3, 2015 at 10:00

Only BoxRatios will not solve your problem. You have to fix the PlotRange also. For example take 2(x^2+y^2)

Plot3D[2 (x^2 + y^2), {x, -1, 1}, {y, -1, 1}, BoxRatios -> 1, FaceGrids -> All]


As you can see the unit along z direction is twice compared to x and y (that's why I choose 2 (x^2 + y^2), to make this point)

Now you fix the PlotRange

plrange = {-1, 1};
Plot3D[2 (x^2 + y^2), {x, -1, 1}, {y, -1, 1}, BoxRatios -> 1,
FaceGrids -> All, PlotRange -> {plrange, plrange, plrange + 1}]


And your units are same in all directions.

• Certainly, an inappropriate setting of BoxRatios will not fix OP's problem. Set properly, one will not have to fiddle with PlotRange unless desired. Commented Jul 3, 2015 at 10:08
• It may be worth mentioning explicitly that if you do not want to display a cubic domain, then you can do some math between BoxRatios and PlotRange. Example if you want PlotRange->{ {-a,b},{-c,d},{-h,j} }, then you need BoxRatios->{ a+b, c+d, h+j }. It may also be worth noting that this may be inexact. I can see on my plot that some of the axes are slightly larger than the domain specified by PlotRange. However, it seems to make a nearly unnoticeable visual difference. Commented Jun 16, 2021 at 11:54