开发者

matplotlib: how to hide grey border around the plot

I'd like to save figurecanvas as bitmap and don't need grey border around the plot开发者_如何学运维 in it. How can I hide this?


I believe that savefig will not include the gray border by default. However, .bmp is not support by savefig; use .png instead.

import pylab
f = pylab.figure()
ax = f.add_axes([0.1, 0.1, 0.8, 0.8])
ax.plot([1,2,3],[4,5,6])
f.savefig('image.png')

Output:

matplotlib: how to hide grey border around the plot


(source: stevetjoa.com)


I found it: subplots_adjust.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜