mplot3d, set_aspect('equal') doesn't work

Hi all,

this issue has come up before (see
http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg14255.html)
and now it was me who got bitten by it: As far as I can see, for
mplot3d axes, it is not possible to set the aspect ratio of the axes
to something other than 'auto' -- anyways, 'equal' does *not* make
sure that the units of lenght on all axes are the same.

For me, this functionality is important as I would like to highlight
that certain angles are right angles which obviously isn't the case if
the illustrations are distorted in that way.

Cheers,
Nico

Also, set_{x,y,z}lim3d() doesn't seem to influence the plot at all. ?

--Nico

···

On Mon, Jul 4, 2011 at 6:54 PM, Nico Schlömer <nico.schloemer@...287...> wrote:

Hi all,

this issue has come up before (see
[Matplotlib-users] cannot set mplot3d axes aspect to "equal")
and now it was me who got bitten by it: As far as I can see, for
mplot3d axes, it is not possible to set the aspect ratio of the axes
to something other than 'auto' -- anyways, 'equal' does *not* make
sure that the units of lenght on all axes are the same.

For me, this functionality is important as I would like to highlight
that certain angles are right angles which obviously isn't the case if
the illustrations are distorted in that way.

Cheers,
Nico

Nico,

That is correct. Due to the design of the mplot3d module, many functions that are expected to work for 2D plots do not work for 3D plots. I have been working on bringing mplot3d to feature-pariety with the rest of mpl. The upcoming release should address many of these issues. However, the set_aspect issue is a harder nut to crack correctly.

If you need a work-around, I have a git branch where I introduce the matlab-esque pbaspect where one can specify the ratios of the x, y, and z axes relative to each other. Note that right now, at least one has to be 1. It does introduce some other bugs, though, which is why it won’t be in the next release.

https://github.com/WeatherGod/matplotlib/tree/mplot3d%2Fpbaspect

Keep an eye on that branch for future updates, though.

I hope this helps,

Ben Root

···

On Mon, Jul 4, 2011 at 11:54 AM, Nico Schlömer <nico.schloemer@…287…> wrote:

Hi all,

this issue has come up before (see

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg14255.html)

and now it was me who got bitten by it: As far as I can see, for

mplot3d axes, it is not possible to set the aspect ratio of the axes

to something other than ‘auto’ – anyways, ‘equal’ does not make

sure that the units of lenght on all axes are the same.

For me, this functionality is important as I would like to highlight

that certain angles are right angles which obviously isn’t the case if

the illustrations are distorted in that way.

Cheers,

Nico

Do you have an example demonstrating this? Also, which version of matplotlib are you using? These functions should work as expected in version 1.0.1.

Ben Root

···

On Mon, Jul 4, 2011 at 11:58 AM, Nico Schlömer <nico.schloemer@…287…> wrote:

Also, set_{x,y,z}lim3d() doesn’t seem to influence the plot at all. ?

–Nico