|
From: Humufr <hu...@ya...> - 2004-12-01 14:34:55
|
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
|