Help on savefig parameters

Rob Gaddi rgaddi at technologyhighland.invalid
Tue Nov 17 11:39:15 EST 2015


On Tue, 17 Nov 2015 08:31:08 -0800, fl wrote:

> Hi,
> I find the parameters of savefig function has the similar format of that
> of main(*argc, **argv) in C. I have tried with savefig("temp.pdf",
> format='pdf'),
> and it works. I get the help content of savefig() as below.
> But I cannot understand why they also give:
> 
> savefig(fname, dpi=None, facecolor='w', edgecolor='w', ...
> 
> For me, it looks like the first item, i.e. 'args' is missing.
> Could you explain it to me?
> 
> Thanks,
> 
> ////////////////
> savefig(*args, **kwargs)
>     Save the current figure.
>     
>     Call signature::
>     
>       savefig(fname, dpi=None, facecolor='w', edgecolor='w',
>               orientation='portrait', papertype=None, format=None,
>               transparent=False, bbox_inches=None, pad_inches=0.1,
>               frameon=None)

Numpy/scipy/matplotlib are in large part autogenerated code from the 
underlying libraries; that's where the default *args, **kwargs arguments 
are coming from.  The signature given in the documentation is the one 
that actually matters.

Prefer the web documentation to the inline docs for that entire set of 
libraries; it'll make your life easier.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.



More information about the Python-list mailing list