首页 > 解决方案 > 配置缩放轴的距离

问题描述

我正在尝试放大我的情节,但是,我得到了两个不同的不想要的情节。下图举例说明了我得到的。

在此处输入图像描述 在此处输入图像描述

这是我的代码,我不确定问题可能是什么,因为我没有这种zoomed_inset_axes的经验。任何指导将不胜感激。

def doscatterplot2(xcoord,ycoord,labellist,limits,ax=None):
   ax = ax
   ax.scatter(xcoord, ycoord,label=labellist,marker='o',facecolors='none', edgecolors='seagreen')
   # Zoom 1.
   axins = zoomed_inset_axes(ax, -1,loc='center',bbox_to_anchor=(0.1, 0.1),bbox_transform=ax.figure.transFigure)
   axins.scatter(xcoord, ycoord)
   axins.axis([-0.1, 0.1, -25, 35])
   axins.xaxis.tick_top()
   mark_inset(ax, axins, loc1=2, loc2=4)
   axins.xaxis.set_major_locator(MaxNLocator(nbins=1, prune='lower'))
return

标签: pythonzooming

解决方案


推荐阅读