From: Norbert N. <Nor...@gm...> - 2004-12-01 19:54:22
|
Hi there, apart from the "gry"-typo, the currect CVS-code really is in a broken state after my patch was applied and half-way reverted back. (The python2.2-pop problem) Possible solutions: * change "kwargs.get('xxx',def)" to "popd(kwargs,'xxx',def)" and add popd to the import from cbook * change "kwargs.get('xxx',def)" to "kwargs.pop('xxx',def)" (will not work for Python 2.2 * change the last lines of Axes.legend according to: lines = flatten(lines) + kwargs["loc"] = loc + self.legend_ = Legend(self, lines, labels, **kwargs) - self.legend_ = Legend(self, lines, labels, loc, **kwargs) return self.legend_ I guess, the first solution is, what will be done in the long run. Ciao, Nobbi Am Mittwoch, 1. Dezember 2004 15:34 schrieb Humufr: > Hi John, > > I tried: > > Yep, it's a bug. Replace the indicate line from > > axes.py > > > > loc = kwargs.gry('loc', 1) > > > > with > > > > loc = kwargs.get('loc', 1) > > ^^^ > > That correct the problem with legend() but I have another problem and I > think it's another bug (not sure) it's not possible to tell to > matplotlib in this case o use the "loc" keywords more it's impossible to > use this keywords. There are always an error message: > File "<string>", line 3, in legend > File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 1502, > in legend > self.legend_ = Legend(self, lines, labels, loc, **kwargs) > TypeError: __init__() got multiple values for keyword argument 'loc' > > > example: > > plot ([2,3],[4,5]) > legend(('toto'),loc=2) > > I tried everything: loc='upper left', loc=0,1 , loc=(0,1), loc=2 etc. > Nothing work but if I omit the " loc= " . It's ok and that explain > probably why I cant do something like: > > plot([1,2],[4,5],label='toto') > legend(loc='upper left') > > > Another strange thing I remark is: > > if you are doing: > > plot([1,2],[4,5]) > legend(('toto')) > > the text for the legend is vertical and not horizontal, that's work > normally when we are using more than one argument. > > Thank you very much for you fast answer and sorry for the second > question I had to verify more precisely in the archival. > > > Nicolas > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- _________________________________________Norbert Nemec Bernhardstr. 2 ... D-93053 Regensburg Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199 eMail: <No...@Ne...> |