我只是用mpl1.4.0绘制一个简单的散点图。我想控制我正在打印的地物上的虚线数,因为当前即使我设置了线型,虚线之间的距离也太近,因此看起来不像一条正确的虚线。在
#load cdeax,cdeay,gsix,gsiy,reich all are arrays of shape (380,)
figfit = plt.figure(); axfit = figfit.gca()
axfit.plot(cdeax,np.log(cdeay),'ko', alpha=.5); axfit.plot(gsix,np.log(gsiy), 'kx')
axfit.plot(cdeax,cdeafit,'k-'); axfit.plot(gsix,gsifit,'k:')
longevityregplot[1].plot(gsix,np.log(reich_l),'k-.')
不过,以上是我得到的。不是一条统一的虚线,这些线在端点处以不同程度的虚线出现,但是不管我使用什么样的虚线值,虚线永远都不是统一的。在
恐怕我真的不知道这里有什么问题。。。有什么想法吗?在
我已经粘贴了我在这里使用的数组:http://pastebin.com/rJ5Jjfmm 您应该能够将它们复制/粘贴到您的IDE中,以便上面的代码运行。在
干杯!在
编辑:
只需绘制一条直线:
axfit.plot(cdeax,cdeafit,'k-',dashes = [10,10]);
编辑2:pastebin链接已更改为包括所有数据
编辑3:沿x轴的点密度直方图:
我想@cphlewis说的是对的,你可能有一些x轴回溯。如果我把所有的东西都分类,我觉得没问题(我自己试穿了,因为我在pastebin上还是看不到适合的地方)
相关问题 更多 >
编程相关推荐