On Tue, Sep 16, 2008 at 2:14 PM, Jack Sankey <[EMAIL PROTECTED]> wrote: > Hello, > I couldn't find this in the API changes, but when I upgraded to the latest > matplotlib 0.98.2, I found (after much hair pulling) that > gca().plot([1,2,1], label='_anything') > will produce a plot and > gca().legend() > will not display the specified label. I had been using filenames starting > with underscores before and _nolabel_ to keep from showing a legend entry. > Is this a bug or has the philosophy changed to eliminate anything starting > with an underscore from the legend? I think if anything None or maybe "" > should be used for empty labels.
I had to check the code to see why this was so, but we do exclude everything that starts with an underscore, even though we only document the '_nolegend_'. I suspect that this change was designed to support the autolabeling of lines when added without a label. In Axes.add_line: if not line.get_label(): line.set_label('_line%d'%len(self.lines)) but I don't recall why we added this bit of functionality. I'm not sure at this point if we should change the doc to reflect reality or change reality to reflect the doc, so perhaps someone using the auto-labeled line feature should chime in here. > Second, I am using interactive mode and WXAgg in windows. So my startup > script does this: > import matplotlib as _mpl > _mpl.use('WXAgg') > import pylab as _p > _p.ion() > Before, when I would then type > gca().plot([1,2,1]) I would not expect a draw here, since draw only happens on pylab commands. Eg _p.plot should trigger a draw, but not gca().plot because the latter is an axes method. I don't really know why it would have worked before, if it did. I would be pretty surprised if it did, actually. JDH ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel