MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / get_legend_handles_labels

Method get_legend_handles_labels

lib/matplotlib/axes/_axes.py:219–231  ·  view source on GitHub ↗

Return handles and labels for legend ``ax.legend()`` is equivalent to :: h, l = ax.get_legend_handles_labels() ax.legend(h, l)

(self, legend_handler_map=None)

Source from the content-addressed store, hash-verified

217 return title
218
219 def get_legend_handles_labels(self, legend_handler_map=None):
220 """
221 Return handles and labels for legend
222
223 ``ax.legend()`` is equivalent to ::
224
225 h, l = ax.get_legend_handles_labels()
226 ax.legend(h, l)
227 """
228 # pass through to legend.
229 handles, labels = mlegend._get_legend_handles_labels(
230 [self], legend_handler_map)
231 return handles, labels
232
233 @_docstring.interpd
234 def legend(self, *args, **kwargs):

Callers 5

test_legend_ordereddictFunction · 0.80
test_hist_unused_labelsFunction · 0.80
test_triplot_labelFunction · 0.80

Calls

no outgoing calls

Tested by 5

test_legend_ordereddictFunction · 0.64
test_hist_unused_labelsFunction · 0.64
test_triplot_labelFunction · 0.64