I am trying to make an inset plot using matplotlib. Currently I have something like the last answer in How to zoomed a portion of image and insert in the same plot in matplotli
For anyone else looking for this, it turns out this can be accomplished by using the inset_axes()
method rather than zoomed_inset_axes()
.
For example:
axins = inset_axes(ax, 1,1 , loc=2,bbox_to_anchor=(0.2, 0.55),bbox_transform=ax.figure.transFigure) # no zoom
The 1,1
section sets the width and height of the inset, respectively. After this, use the xlim()
and ylim()
to set the extents of the axes without changing the size or shape of the inset box.