python - 配置缩放轴的距离
问题描述
我正在尝试放大我的情节,但是,我得到了两个不同的不想要的情节。下图举例说明了我得到的。
这是我的代码,我不确定问题可能是什么,因为我没有这种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
解决方案
推荐阅读
- ios - 使用 AFNetworking 删除 XML 标头
- php - ssh cannot connect to git server in php
- c# - 在循环内声明变量的算法的空间复杂度
- mongodb - 如何更改 MongoDB 日志的日志级别?
- arrays - 从java中的未排序数组中删除重复项
- sql - 在具有相同架构的表上使用视图
- java - 我的数据与用户输入和数据库不一样
- java - Swing:当我使用 Toolkit.getDefaultToolkit().sync(); 时,动画仍然卡顿;
- python - 如何在 python 中使用 Tkinter 库获取简单的绘图应用程序以在屏幕上显示结果?
- matlab - Matlab中两条相交曲线的轮廓