Different x and y scale in zoomed inset, matplotlib

前端 未结 1 709
情深已故
情深已故 2021-02-08 01:39

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

1条回答
  •  野性不改
    2021-02-08 02:07

    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.

    0 讨论(0)
提交回复
热议问题