How do i change the dimensions of an inset axes object?
I'm creating a plot like this:

I would like the inset to be wider, the zoomed_inset_axes method defaults to the same aspect ratio as the underlying data (sensibly i guess), but it seems to resist any attempt I make to change it...
I'm using it like this:
axins.axis(args.inset_extent)
os = axins.get_position()
pos = [pos.x0, pos.y0, pos.width * 2, pos.height]
axins.set_position(pos)
I've tried the which kwarg of set_position too, and that also appears to do nothing.
How can i set the position of the inset plot, and more importantly change it's aspect ratio?
It's part of a reasonably long plotting script, the full code is here, and a couple of example basis sets to try it are here: 6-31G.dat and 3-21G.dat.
Just download them into their own dir, and put the basis set files in a dir called basis_sets, and then use the command:
./basis_sets.py -r -2 2 -b 6-31G 3-21G -a C --inset --inset-zoom 6 --inset-extent -0.03 0.03 6.7 7.7
(./basis_sets.py --help prints out usage guide)
So i found another function in there, just called inset_axes.
It's used a little differently, but does exactly what i want, and the mark_inset helper function still works too, which is nice.
So now i have:
ax = inset_axes(ax, width=XX, height=XX, loc=XX)
ax.axis([x0, x1, y0, y1])
istead of the zoom one and it is much more flexible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With