automatic label setting in Axes.add_* methods?


add_line method sets label to something like "_line1" if not set.

def add_line(self, line):

        if not line.get_label():

add_collection sets label to "collection1" if not set.

def add_collection(self, collection, autolim=True):

        label = collection.get_label()
        if not label:

add_patch does nothing.

Can someone enlighten me why add_line and add_collection method sets the label?

Actually, my issue here is that collections without empty label show
up in the legend as "collection1" etc., instead of being ignored.