保存/恢复打印限制
axclf的Python项目详细描述
AXCLF
在迭代和交互期间保存/恢复MatplotLib轴限制 发展。
背景
当使用单元模式功能时,此功能变得非常有用 在IDLEX、Spyder、IEP等编辑器中,在算法原型过程中, 生成绘图。这些助手例程允许检查 情节的感兴趣区域,然后运行更改以查看其效果 无需重新缩放/平移到感兴趣的区域。
示例
from pylab import *
from axclf import *
ion()
## interactive cell
figure(1)
axclf() # save axes limits and clear figure
ex = 6 # adjust this number when re-running, (CTRL+Plus in IdleX)
x = linspace(0, 10, 1000)
y = sin(x) ** ex
plot(x, y)
axrestore() # restore axes limits