On Fri, Jul 30, 2010 at 9:54 AM, Damon McDougall
<d.mcdoug...@warwick.ac.uk>wrote:

> Hi,
>
> I'm interested in fiddling around with the matplotlib source. Let's say we
> set up various things:
>
> from matplotlib.figure import Figure()
> from matplotlib.backends.backend_pdf import FigureCanvasPdf as FigureCanvas
>
> fig = Figure()
> canvas = FigureCanvas(fig)
> ax = fig.add_subplot(1, 1, 1)
> fig.savefig('asd.pdf', bbox_inches='tight')
>
> I would like to know what exactly happens when bbox_inches='tight' is
> passed to savefig(). I've been searching in the figure.py source and nowhere
> can I see the bbox_inches='tight' keyword being tested for in the savefig()
> method. Having said that, all of the kwargs do get passed on to the
> canvas.print_figure() method, so I looked in the backend_pdf.py file but
> couldn't find a print_figure() method. Could someone point me in the right
> direction?
>
> Regards,
> -- Damon
>
>
That is because the FigureCanvasPdf class inherits from the
FigureCanvasBase, which defines the .savefig() function.  You will find that
in backend_bases.py.

I hope this helps,
Ben Root
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to