根据文档页面: http://matplotlib.sourceforge.net/api/pyplot_api.html 使用axvline的方式就像是matplotlib axvline中的错误?
axvline(x=0, ymin=0, ymax=1)
然而,这并不在我的电脑工作。没有画。相反,只是
axvline(x=0)
没有设置ymin和ymax的作品。
我不确定这是否是一个错误。或者我错过了一些微妙的东西?
matplotlib.__version__
'0.99.1.1'
uname -a
Linux pc20172 2.6.32-41-generiC#94-Ubuntu SMP Fri Jul 6 18:00:34 UTC 2012 x86_64 GNU/Linux
编辑:最小代码重现该问题。
from pylab import *
ion()
plot([1,2])
axvline(x=0.5, ymin=1, ymax=2) # No vertical line is drawn.
clf() # Clear the figure to redo the plot.
plot([1,2])
axvline(x=0.5) # Now the desired vertical line is drawn.
你确定没有画任何东西吗?如果这是图中唯一的一行,请尝试'axvline(x = 0,ymin = 0,ymax = 1,linewidth = 100)'使其更大。 – DSM 2012-08-08 13:51:55
@DSM我不认为线宽有任何问题。我添加了几行代码,您可以测试。 – FJDU 2012-08-08 14:52:48