I want to add an inset axis to the upper left corner of a parent axis. This can easily be done like so:
fig, ax = plt.subplots()
iax = ax.inset_axes([0,.8, .2, .2])
However, I need the inset axis iax
to have an aspect ratio of one. But when I change the aspect ratio, the inset axis shifts slightly to the right.
iax.set_aspect('equal')
How can I make the aspect ratio of the inset axis "equal", while still having it nestled in the upper left corner? I know I could just mess around with the inset_axes location parameter, but ideally I want some method that works for any given axis size.
CodePudding user response: