Quantcast
Channel: Uncategorized - Matplotlib
Viewing all articles
Browse latest Browse all 56

Locking aspect ratio

$
0
0

I want to have a 3D plot where aspect ratio is always equal for the 3 axes, so that angles and lengths are pose-independent. It’s easy enough to set this at a given point in time, with ax.set_aspect(‘equal’). However, every time I plot something on these axes, the aspect ratio reverts to auto, and ax.set_aspect(‘equal’) must be called again, which is REALLY annoying.

What I’d like is to be able to “lock” or “freeze” the aspect ratio, such that even when new plotted points are added, or if the axes are cleared with plt.cla() and a new set of data points is plotted, that the scales of the axes remain equal. How do I do this?

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 56

Trending Articles