【发布时间】:2016-10-17 12:00:23
【问题描述】:
下面显示的在 windows 7 上运行的 python 代码(python 2.7)导致以下关于轴显示的不一致行为,我不明白:
1 - 打开一个窗口并显示一个没有轴的图,显示一个点 2 - 关闭窗口时,打开另一个窗口并显示一个绘图,显示相同的点,但这次有一个轴。
from osgeo import ogr
import pylab
from ospybook.vectorplotter import VectorPlotter
vp = VectorPlotter(False)
myLoc = ogr.Geometry(ogr.wkbPoint)
myLoc.AddPoint(59.5,13)
vp.plot(myLoc,'rs')
pylab.show() ## the plot is displayed --without-- axes displayed
myLoc.AddPoint(59.5,13)
vp.plot(myLoc,'rs')
pylab.show() ## the plot is displayed with axes displayed
请注意,在我的环境中,如果矢量绘图仪交互模式设置为 True,pylab.show() 会打开窗口但不显示绘图。
【问题讨论】:
标签: python matplotlib