SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Andrew S. <str...@as...> - 2004年10月13日 21:29:56
Hi,
In class Axes (current CVS), there is an instance variable self.legend 
as well as a method legend(). For some reason, this seems to work most 
of the time, but I found this problem when I did something like:
ax = subplot(111)
ax.legend(lines,titles)
(A "cannot call NoneType"-type error occurs).
Anyhow, changing all occurrences of self.legend to self._legend in 
Axes.py fixes my problem, but perhaps there are subtleties I'm not aware 
of? If I don't hear any objections, I'll commit these changes in a day 
or two.
Cheers!
Andrew
From: John H. <jdh...@ac...> - 2004年10月13日 21:53:20
>>>>> "Andrew" == Andrew Straw <str...@as...> writes:
 Andrew> Anyhow, changing all occurrences of self.legend to
 Andrew> self._legend in Axes.py fixes my problem, but perhaps
 Andrew> there are subtleties I'm not aware of? If I don't hear
 Andrew> any objections, I'll commit these changes in a day or two.
Arggg,
Yesterday I was writing the section of the users guide in which I
described the Artist containment hierarchy (Figure contains Axes which
contain lines, legends, etc...) and decided it would be most useful
for the diagram to have attribute names as well as class types. In
the process, I made all of the Artist attributes "public" by removing
the leading underscore. I tried to check for method name clashes but
clearly missed this one. Most of the attributes are lists and are
plural (lines, patches, tables). But there is only one legend per
axes (we could change this). So the alternatives are: 1) support
multiple legends or 2) easier, just rename it; how about "thelegend"
or "legend_"
I don't think 1) is really necessary because we already support
multiple figure legends, so you can place multiple legends around or
over an axes manually in the rare cases where you need this.
JDH
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /