-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Description
I had to hack this method due to a TypeError in master. No time for a pull request or unit test
def get_legend_handles_labels(self, legend_handler_map=None):
"""
Return handles and labels for legend
``ax.legend()`` is equivalent to ::
h, l = ax.get_legend_handles_labels()
ax.legend(h, l)
"""
handles = []
labels = []
for handle in self._get_legend_handles(legend_handler_map):
label = handle.get_label()
#if (label is not None and label != '' and not label.startswith('_')):
if label and not (isinstance(label, basestring) and label.startswith('_')):
handles.append(handle)
labels.append(label)
return handles, labels