@@ -89,13 +89,46 @@ def adjust_drawing_area(self, legend, orig_handle,
89
89
return xdescent , ydescent , width , height
90
90
91
91
def scale_dimensions (self , legend , width , height , orig_handle ):
92
+ """
93
+ Return larger of input width/height or width/height of orig_handle
94
+
95
+ Parameters
96
+ ----------
97
+ legend : :class:`matplotlib.legend.Legend` instance
98
+ The legend that will contain the orig_handle
99
+ width : number
100
+ The width that is being compared to width of orig_handle.
101
+ height : number
102
+ The height that is being compared to height of orig_handle.
103
+ orig_handle : :class:`matplotlib.artist.Artist` or similar
104
+ The object that the output width and height must be large
105
+ enough to fit.
106
+
107
+ """
92
108
return (max (width , self .handle_width (legend , orig_handle )),
93
109
max (height , self .handle_height (legend , orig_handle )))
94
110
95
111
def handle_width (self , legend , orig_handle ):
112
+ """
113
+ Charles I'm not sure how to write this
114
+ Return width of orig_handle.
115
+ Default implementation returns -1.
116
+
117
+ Parameters
118
+ ----------
119
+ legend : :class:`matplotlib.legend.Legend` instance
120
+ The legend that will contain the orig_handle.
121
+ orig_handle : :class:`matplotlib.artist.Artist` or similar
122
+ The object that the output width and height must be large
123
+ enough to fit.
124
+
125
+ """
96
126
return - 1
97
127
98
128
def handle_height (self , legend , orig_handle ):
129
+ '''
130
+ Charles
131
+ '''
99
132
return - 1
100
133
101
134
def legend_artist (self , legend , orig_handle ,
@@ -239,6 +272,9 @@ def __init__(self, marker_pad=0.3, numpoints=None, **kw):
239
272
numpoints = numpoints , ** kw )
240
273
241
274
def handle_width (self , legend , orig_handle ):
275
+ '''
276
+ Charles
277
+ '''
242
278
if isinstance (orig_handle , Line2D ):
243
279
marker = orig_handle .get_marker ()
244
280
marker_size = orig_handle .get_markersize ()
@@ -249,6 +285,9 @@ def handle_width(self, legend, orig_handle):
249
285
return - 1
250
286
251
287
def handle_height (self , legend , orig_handle ):
288
+ '''
289
+ Charles
290
+ '''
252
291
if isinstance (orig_handle , Line2D ):
253
292
marker = orig_handle .get_marker ()
254
293
marker_size = orig_handle .get_markersize ()
@@ -687,6 +726,9 @@ def __init__(self, ndivide=1, pad=None, **kwargs):
687
726
HandlerBase .__init__ (self , ** kwargs )
688
727
689
728
def handle_width (self , legend , orig_handle ):
729
+ '''
730
+ Charles
731
+ '''
690
732
handler_map = legend .get_legend_handler_map ()
691
733
largest_width = - 1
692
734
for handle1 in orig_handle :
@@ -696,12 +738,15 @@ def handle_width(self, legend, orig_handle):
696
738
return largest_width
697
739
698
740
def handle_height (self , legend , orig_handle ):
741
+ '''
742
+ Charles
743
+ '''
699
744
handler_map = legend .get_legend_handler_map ()
700
745
largest_height = - 1
701
746
for handle1 in orig_handle :
702
747
handler = legend .get_legend_handler (handler_map , handle1 )
703
748
largest_height = max (largest_height ,
704
- handler .handle_height (legend , handle1 ))
749
+ handler .handle_height (legend , handle1 ))
705
750
return largest_height
706
751
707
752
def create_artists (self , legend , orig_handle ,
0 commit comments