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:
(source: stevetjoa.com)
I found it: subplots_adjust.
精彩评论