Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Scale only 2 axis in a 3d matplotlib

Consider the case where a maplotlib 3d plot have 2 axis that represents the same kind of measurement (for example a length) and another one of a different kind (for example time). I would like to scale only 2 axis (the ones representing the length) but not the other one.
In a 2d plot I would do this with ax.axis("equal"), but this command scales all the axis.

Is there a way to do that?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The Axes3D class has a set_aspect method, which allows you to set the aspect ratio of any pair of axes to equal, e.g.:

ax.set_apect("equalxy")

to set the x-y axes to have equal aspect ratios, but leaving the z-axis scale unchanged.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading