From: John H. <jd...@gm...> - 2008-06-25 13:41:25
|
On Wed, Jun 25, 2008 at 8:25 AM, Stéfan van der Walt <st...@su...> wrote: > 2008/6/25 Michael Droettboom <md...@st...>: >> Maybe this should be made an option on the "transparent" kwarg to savefig, >> something like: >> >> transparent = 'figure' | 'figure_and_axes' >> >> Or is that just making things too complicated? > > Those options would both be very handy. Stefan -- just for a little background. The figure has a matplotlib.patches.Rectangle instance called "figurePatch" and the axes has a Rectangle instance called axesPatch. You can set any property on them directly (facecolor, edgecolor, linewidth, linestyle, alpha). Eg, fig = plt.figure() fig.figurePatch.set_alpha(0.5) ax = fig.add_subplot(111) ax.axesPatch.set_alpha(0.5) Michael's transparent kwarg is just a helper function to do this automatically at save time w/o affecting the screen rendered figure. For stylistic reasons, I'd like a new name for figurePatch and rectanglePatch. "background", "rectangle" and "patch" would all be nicer. I'm inclined toward "rectangle" -- I think I'll just put an alias in Figure and Axes unless someone has a better idea. JDH |