On Fri, Apr 27, 2012 at 10:11 AM, Francesco Montesano <
franz.berges...@googlemail.com> wrote:

> Dear matplotlibers,
>
> I know almost nothing about mpl_toolkits (matplolib.__version__ = 1.1.0).
> >From the help of
> "mpl_toolkits.axisartist.floating_axes.FloatingSubplot", the init
> function reads
> __init__(self, fig, *args, **kwargs)
>
> In the example here
> (
> http://matplotlib.sourceforge.net/examples/axes_grid/demo_floating_axes.html
> )
> the object is initialised as
>  FloatingSubplot(fig, rect, grid_helper=grid_helper)
>
> If I take out 'grid_helper' I get this error:
> "ValueError: FloatingAxes requires grid_helper argument"
>
> In my understanding, **kwargs (like grid_helper) are optional
> arguments and I think that 'required' options do not make much sense.
> Besides its not documented in the help of the class.
>
> Could grid_helper be upgraded to *args?
>
> Cheers,
> Francesco
>
>
Francesco,

Yes and no.  In the most basic sense, the **kwargs are generally considered
as optional.  However, in some very advance python code, we use the
argument unpacking features of (*args, **kwargs) to create a more agnostic
API (duck-typing for call signatures, if you will).  Unfortunately, I don't
think we can update the call signature until we can drop python 2.x support.

The doc string you see when you look up FloatingSubplot is actually from
the class definition a few superclasses up.  If this makes no sense, you
aren't alone... The way FloatingSubplot is made is extremely convoluted and
I am still trying to wrap my head around it.  A docstring should probably
be added for the __init__ function of FloatingAxesBase so that its
constructor could be better explained.

Ben Root
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to