File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 2007-06-02 Display only meaningful labels when calling legend()
2+ without args. - NN
3+
142007-06-02 Have errorbar follow the color cycle even if line is not plotted.
25 Suppress plotting of errorbar caps for capsize=0. - NN
36
Original file line number Diff line number Diff line change @@ -1056,8 +1056,8 @@ def add_line(self, line):
10561056 line .set_clip_box (self .bbox )
10571057
10581058 self ._update_line_limits (line )
1059- label = line .get_label ()
1060- if not label : line .set_label ('line %d' % len (self .lines ))
1059+ if not l .get_label ():
1060+ l .set_label ('_line %d' % len (self .lines ))
10611061 self .lines .append (line )
10621062
10631063 def _update_line_limits (self , line ):
@@ -2890,10 +2890,10 @@ def get_handles():
28902890 if len (args )== 0 :
28912891 handles = []
28922892 labels = []
2893- for line in get_handles ():
2894- label = line .get_label ()
2895- if label != '_nolegend_ ' :
2896- handles .append (line )
2893+ for handle in get_handles ():
2894+ label = handle .get_label ()
2895+ if label is not None and label != '' and label [ 0 ] != '_ ' :
2896+ handles .append (handle )
28972897 labels .append (label )
28982898 loc = popd (kwargs , 'loc' , 1 )
28992899
@@ -2917,7 +2917,7 @@ def get_handles():
29172917 # LINES, LABELS, LOC
29182918 handles , labels , loc = args
29192919 else :
2920- raise RuntimeError ('Invalid arguments to legend' )
2920+ raise TypeError ('Invalid arguments to legend' )
29212921
29222922
29232923 handles = flatten (handles )
You can’t perform that action at this time.
0 commit comments