On Fri, Feb 25, 2011 at 9:15 PM, Yuri D'Elia <wav...@users.sf.net> wrote:
> 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



>
> 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
>

------------------------------------------------------------------------------
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

Reply via email to