2012-05-30 16 views

回答

1

一個更好的辦法是通過英寸到指定畫布的大小。所以字體(默認值是10點,看起來更小,數據點也是這樣)。你可以選擇任何你想要的大小,

# in this case 3 inches times 3 inches 
fig = pyplot.figure(figsize=(3,3)) 
ax = fig.add_subplot(111) 

但被警告,那麼您應該將圖像保存到文件,而不是試圖與節目進行查看()。

fig.savefig('mycoolgraph.png') # you could also you vector formats like PDF or SVG... 

另請參閱此question about saving the legend outside the figure

1

命令xlim(0, 100)設置的X限制(或ax.set_xlim(0, 100)如果您使用的編程matplotlib面向對象式)