savefig bbox_inches='tight' does not consider suptitle

In the following:

<<<<<<<<<<<
import matplotlib as mpl
import matplotlib.figure
import matplotlib.backends.backend_agg

fig = mpl.figure.Figure()
cvs = mpl.backends.backend_agg.FigureCanvasAgg(fig)
fig.set_size_inches((20,20))
fig.suptitle("Horray!", fontsize=20)
plot = fig.add_subplot(111)
plot.set_title("Subtitle")
plot.plot([1,2,3], [3,2,1])
fig.savefig("out.png", bbox_inches='tight')

suptitle is stripped from the figure.
Of course the title is present if you unset bbox_inches, but that's unexpected behavior for me.

Is this a bug?

Thanks

In the following:

<<<<<<<<<<<
import matplotlib as mpl
import matplotlib.figure
import matplotlib.backends.backend_agg

fig = mpl.figure.Figure()
cvs = mpl.backends.backend_agg.FigureCanvasAgg(fig)
fig.set_size_inches((20,20))
fig.suptitle("Horray!", fontsize=20)
plot = fig.add_subplot(111)
plot.set_title("Subtitle")
plot.plot([1,2,3], [3,2,1])
fig.savefig("out.png", bbox_inches='tight')

suptitle is stripped from the figure.
Of course the title is present if you unset bbox_inches, but that's unexpected behavior for me.

Is this a bug?

Unfortunately, bbox_inches option is never meant to be complete in
figuring out the exact size of the figure area.
However, you can use "bbox_extra_artists" keyword argument to specify
additional artists that should be considered when dertermining the
plot size.

mytitle = fig.suptitle("Horray!", fontsize=20)

...

fig.savefig("out.png", bbox_inches='tight', bbox_extra_artists=[mytitle])

Regards,

-JJ

···

On Fri, Feb 25, 2011 at 9:15 PM, Yuri D'Elia <wavexx@...867...> wrote:

Thanks

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

> Is this a bug?

Unfortunately, bbox_inches option is never meant to be complete in
figuring out the exact size of the figure area.

Why not? What's the purpose of bbox_inches='tight' otherwise?

However, you can use "bbox_extra_artists" keyword argument to specify
additional artists that should be considered when dertermining the
plot size.

mytitle = fig.suptitle("Horray!", fontsize=20)

...

fig.savefig("out.png", bbox_inches='tight', bbox_extra_artists=[mytitle])

That doesn't work for me either.

···

On Tue, 1 Mar 2011 12:44:20 +0900 Jae-Joon Lee <lee.j.joon-Re5JQEeQqe8AvxtiuMwx3w@...1455...> wrote: