sending again, doesnt seem to have gone through...

hi, with the simple script below, how can i make the image have a
transparent background instead of white? it's saving RGB, not RGBA.
thanks,
-brent


import matplotlib
matplotlib.use('Agg')
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure

fig = Figure()
canvas = FigureCanvas(fig)

dpi = 64

fig.set_size_inches(256/dpi, 256/dpi)
#fig.figurePatch.set_alpha(1.)
fig.set_alpha(1.)
ax = fig.add_axes((0,0,1,1), axis_bgcolor=(1, 1, 1, 1.), alpha=1.,
frame_on=False, xticks=(), yticks=())

ax.plot([1,2,3])

fig.set_facecolor((1.,1.,1.,1.))
canvas.print_figure('t.png', dpi=dpi, facecolor=(1.,1.,1.,1.))

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to