From: Fernando P. <Fer...@co...> - 2004-11-23 18:59:18
|
John Hunter schrieb: >>>>>>"Norbert" == Norbert Nemec <Nor...@gm...> writes: > > > Norbert> Hi there, again a few patches, mostly independent but > Norbert> somewhat interconnected: > > Hi Norbert, thanks for the patches. I applied these, but used a > somewhat different strategy for legend kwargs. Details below. > > Norbert> axes-kwargs: a general cleanup of the code in axes.py - > Norbert> in several places, kwargs was handled inconsistently, > Norbert> ignoring surplus arguments. I went through all uses of > Norbert> kwargs and made sure that every argument is either used > Norbert> or reported as error > > There was a bug in the pcolor patch of the axes kwargs > > alpha = kwargs.pop('alpha', 1.0) > norm = kwargs.pop('norm') > cmap = kwargs.pop('cmap') > vmin = kwargs.pop('vmin') > vmax = kwargs.pop('vmax') > > pop doesn't return a default value like get does, so if you want to > default to None (which we do here) you must explicitly return it > > norm = kwargs.pop('norm', None) > cmap = kwargs.pop('cmap', None) > > ...etc... Quick heads-up: planck[~]> ip Python 2.3.3 (#1, May 7 2004, 10:31:40) Type "copyright", "credits" or "license" for more information. IPython 0.6.5.cvs -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: a={1:2,3:4} In [2]: a.p a.pop a.popitem BUT (note python version number below): haar[~]> ip Python 2.2.3 (#1, Oct 15 2003, 23:33:35) Type "copyright", "credits" or "license" for more information. IPython 0.6.5.cvs -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: a={1:2,3:4} In [2]: a.popitem Python 2.2 dicts do NOT have a pop() method, this appeared in python 2.3. It's fine if you decide to make matplotlib fully 2.3-dependent, but I just wanted to make you at least aware of this fact. 2.2 is still in reasonably wide use in the field, so if you are going to drop support for it, you might want to put a big fat warning about this fact, just to save users the hassle of weird bugs. Best, f |