I'm trying to get a plot done using Python.matplotlib
in which I would add to a first plot a zoomed region in a box located in the lower right corner.
Looking at documentation and examples, I know that this is usually done using zoomed_inset_axes
but it seems to only take one factor for zooming/dilating for both directions when I'd like to dilate only along the y axis (looking at the attached picture it is easy to guess why). So I tried to give a bbox scaled as I would like but it doesn't seem to do the trick. Is there an axis transformation or a data operation that could help me?
The red arrows and box described the size I would like my box to take (more or less, I'll tune later of course).
Edit:
I've been playing with it a bit more and my problem seems to be that the two graphs, in the current state, do share the same y-axis scale.
Here is my code, by the way, should have been included in the first place:
ax = plt.gca()
axins = zoomed_inset_axes(ax, 1, loc=4)
axins.scatter(x,y, lw=0.1,c="#1B9E77",alpha=0.8)
x1, x2, y1, y2 = -75, 5200, -0.31, -0.18 #coordinates of the region I'm zooming in
axins.plot(N.linspace(x1,x2,100),[-0.25]*100,c="#EFD807",lw=3) #yellow line
axins.set_xlim(x1, x2)
axins.set_ylim(y1, y2)
mark_inset(ax, axins, loc1=3, loc2=1, fc="none", ec="0.5")