-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathlegend_api.html
More file actions
1035 lines (944 loc) · 71.6 KB
/
legend_api.html
File metadata and controls
1035 lines (944 loc) · 71.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>legend and legend_handler — Matplotlib 2.1.2 documentation</title>
<link rel="stylesheet" href="../_static/mpl.css"
type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css"
type="text/css" />
<link rel="stylesheet" href="../_static/gallery.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '2.1.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="Search within Matplotlib 2.1.2 documentation"
href="../_static/opensearch.xml"/>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html"
/>
<link rel="search" title="Search" href="../search.html"
/>
<link rel="top" title="Matplotlib 2.1.2 documentation" href="../index.html" />
<link rel="up" title="The Matplotlib API" href="index.html" />
<link rel="next" title="lines" href="lines_api.html" />
<link rel="prev" title="image" href="image_api.html" />
<link rel="canonical" href="https://matplotlib.org/stable/api/legend_api.html" />
<script data-domain="matplotlib.org" defer="defer" src="https://views.scientific-python.org/js/script.js"></script>
</head>
<body>
<div id="unreleased-message"> You are reading an old version of the documentation (v2.1.2). For the latest version see <a href="https://matplotlib.org/stable/api/legend_api.html">https://matplotlib.org/stable/api/legend_api.html</a></div>
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px; position: relative;">
<a href="../index.html">
<div style="float: left; position: absolute; width: 496px; bottom: 0; padding-bottom: 24px"><span style="float: right; color: #789; background: white">Version 2.1.2</span></div>
<img src="../_static/logo2.png" height="125px" border="0" alt="matplotlib"/></a>
<!-- The "Fork me on github" ribbon -->
<div id="forkongithub"><a href="https://github.com/matplotlib/matplotlib">Fork me on GitHub</a></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="lines_api.html" title="lines"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="image_api.html" title="image"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">home</a>| </li>
<li><a href="../gallery/index.html">examples</a>| </li>
<li><a href="../tutorials/index.html">tutorials</a>| </li>
<li><a href="pyplot_summary.html">pyplot</a>| </li>
<li><a href="../contents.html">docs</a> »</li>
<li><a href="index.html" accesskey="U">The Matplotlib API</a> »</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><a href="https://www.numfocus.org">
<image src="https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A">
</a>
<br/>
<a href="http://depsy.org/package/python/matplotlib">
<img src="../_static/depsy_badge.svg">
</a>
<br/>
Travis-CI: <a href="https://travis-ci.org/matplotlib/matplotlib">
<img src="https://travis-ci.org/matplotlib/matplotlib.svg?branch=master"/>
</a>
<br/>
<h3><a href="../contents.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">legend and legend_handler</a><ul>
<li><a class="reference internal" href="#module-matplotlib.legend"><code class="docutils literal"><span class="pre">matplotlib.legend</span></code></a></li>
<li><a class="reference internal" href="#module-matplotlib.legend_handler"><code class="docutils literal"><span class="pre">matplotlib.legend_handler</span></code></a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../contents.html">Documentation overview</a><ul>
<li><a href="index.html">The Matplotlib API</a><ul>
<li>Previous: <a href="image_api.html" title="previous chapter">image</a></li>
<li>Next: <a href="lines_api.html" title="next chapter">lines</a></li>
</ul></li>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/api/legend_api.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="legend-and-legend-handler">
<h1>legend and legend_handler<a class="headerlink" href="#legend-and-legend-handler" title="Permalink to this headline">¶</a></h1>
<div class="section" id="module-matplotlib.legend">
<span id="matplotlib-legend"></span><h2><a class="reference internal" href="#module-matplotlib.legend" title="matplotlib.legend"><code class="xref py py-mod docutils literal"><span class="pre">matplotlib.legend</span></code></a><a class="headerlink" href="#module-matplotlib.legend" title="Permalink to this headline">¶</a></h2>
<p>The legend module defines the Legend class, which is responsible for
drawing legends associated with axes and/or figures.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">It is unlikely that you would ever create a Legend instance manually.
Most users would normally create a legend via the
<a class="reference internal" href="_as_gen/matplotlib.axes.Axes.legend.html#matplotlib.axes.Axes.legend" title="matplotlib.axes.Axes.legend"><code class="xref py py-meth docutils literal"><span class="pre">legend()</span></code></a> function. For more details on legends
there is also a <a class="reference internal" href="../tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py"><span class="std std-ref">legend guide</span></a>.</p>
</div>
<p>The Legend class can be considered as a container of legend handles
and legend texts. Creation of corresponding legend handles from the
plot elements in the axes or figures (e.g., lines, patches, etc.) are
specified by the handler map, which defines the mapping between the
plot elements and the legend handlers to be used (the default legend
handlers are defined in the <a class="reference internal" href="#module-matplotlib.legend_handler" title="matplotlib.legend_handler"><code class="xref py py-mod docutils literal"><span class="pre">legend_handler</span></code></a> module).
Note that not all kinds of artist are supported by the legend yet by default
but it is possible to extend the legend handler’s capabilities to support
arbitrary objects. See the <a class="reference internal" href="../tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py"><span class="std std-ref">legend guide</span></a> for more information.</p>
<dl class="class">
<dt id="matplotlib.legend.DraggableLegend">
<em class="property">class </em><code class="descclassname">matplotlib.legend.</code><code class="descname">DraggableLegend</code><span class="sig-paren">(</span><em>legend</em>, <em>use_blit=False</em>, <em>update='loc'</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.DraggableLegend" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="offsetbox_api.html#matplotlib.offsetbox.DraggableOffsetBox" title="matplotlib.offsetbox.DraggableOffsetBox"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.offsetbox.DraggableOffsetBox</span></code></a></p>
<dl class="docutils">
<dt>update <span class="classifier-delimiter">:</span> <span class="classifier">If “loc”, update <em>loc</em> parameter of</span></dt>
<dd>legend upon finalizing. If “bbox”, update
<em>bbox_to_anchor</em> parameter.</dd>
</dl>
<dl class="method">
<dt id="matplotlib.legend.DraggableLegend.artist_picker">
<code class="descname">artist_picker</code><span class="sig-paren">(</span><em>legend</em>, <em>evt</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.DraggableLegend.artist_picker" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend.DraggableLegend.finalize_offset">
<code class="descname">finalize_offset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.DraggableLegend.finalize_offset" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend.Legend">
<em class="property">class </em><code class="descclassname">matplotlib.legend.</code><code class="descname">Legend</code><span class="sig-paren">(</span><em>parent</em>, <em>handles</em>, <em>labels</em>, <em>loc=None</em>, <em>numpoints=None</em>, <em>markerscale=None</em>, <em>markerfirst=True</em>, <em>scatterpoints=None</em>, <em>scatteryoffsets=None</em>, <em>prop=None</em>, <em>fontsize=None</em>, <em>borderpad=None</em>, <em>labelspacing=None</em>, <em>handlelength=None</em>, <em>handleheight=None</em>, <em>handletextpad=None</em>, <em>borderaxespad=None</em>, <em>columnspacing=None</em>, <em>ncol=1</em>, <em>mode=None</em>, <em>fancybox=None</em>, <em>shadow=None</em>, <em>title=None</em>, <em>framealpha=None</em>, <em>edgecolor=None</em>, <em>facecolor=None</em>, <em>bbox_to_anchor=None</em>, <em>bbox_transform=None</em>, <em>frameon=None</em>, <em>handler_map=None</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="artist_api.html#matplotlib.artist.Artist" title="matplotlib.artist.Artist"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.artist.Artist</span></code></a></p>
<p>Place a legend on the axes at location loc. Labels are a
sequence of strings and loc can be a string or an integer
specifying the legend location</p>
<ul class="simple">
<li><em>parent</em>: the artist that contains the legend</li>
<li><dl class="first docutils">
<dt><em>handles</em>: a list of artists (lines, patches) to be added to the</dt>
<dd>legend</dd>
</dl>
</li>
<li><em>labels</em>: a list of strings to label the legend</li>
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>loc</strong> : int or string or pair of floats, default: ‘upper right’</p>
<blockquote>
<div><p>The location of the legend. Possible codes are:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="54%" />
<col width="46%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Location String</th>
<th class="head">Location Code</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>‘best’</td>
<td>0</td>
</tr>
<tr class="row-odd"><td>‘upper right’</td>
<td>1</td>
</tr>
<tr class="row-even"><td>‘upper left’</td>
<td>2</td>
</tr>
<tr class="row-odd"><td>‘lower left’</td>
<td>3</td>
</tr>
<tr class="row-even"><td>‘lower right’</td>
<td>4</td>
</tr>
<tr class="row-odd"><td>‘right’</td>
<td>5</td>
</tr>
<tr class="row-even"><td>‘center left’</td>
<td>6</td>
</tr>
<tr class="row-odd"><td>‘center right’</td>
<td>7</td>
</tr>
<tr class="row-even"><td>‘lower center’</td>
<td>8</td>
</tr>
<tr class="row-odd"><td>‘upper center’</td>
<td>9</td>
</tr>
<tr class="row-even"><td>‘center’</td>
<td>10</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Alternatively can be a 2-tuple giving <code class="docutils literal"><span class="pre">x,</span> <span class="pre">y</span></code> of the lower-left
corner of the legend in axes coordinates (in which case
<code class="docutils literal"><span class="pre">bbox_to_anchor</span></code> will be ignored).</p>
</div></blockquote>
<p><strong>bbox_to_anchor</strong> : <a class="reference internal" href="transformations.html#matplotlib.transforms.BboxBase" title="matplotlib.transforms.BboxBase"><code class="xref py py-obj docutils literal"><span class="pre">BboxBase</span></code></a> or pair of floats</p>
<blockquote>
<div><p>Specify any arbitrary location for the legend in <code class="xref py py-obj docutils literal"><span class="pre">bbox_transform</span></code>
coordinates (default Axes coordinates).</p>
<p>For example, to put the legend’s upper right hand corner in the
center of the axes the following keywords can be used:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">loc</span><span class="o">=</span><span class="s1">'upper right'</span><span class="p">,</span> <span class="n">bbox_to_anchor</span><span class="o">=</span><span class="p">(</span><span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">)</span>
</pre></div>
</div>
</div></blockquote>
<p><strong>ncol</strong> : integer</p>
<blockquote>
<div><p>The number of columns that the legend has. Default is 1.</p>
</div></blockquote>
<p><strong>prop</strong> : None or <a class="reference internal" href="font_manager_api.html#matplotlib.font_manager.FontProperties" title="matplotlib.font_manager.FontProperties"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.font_manager.FontProperties</span></code></a> or dict</p>
<blockquote>
<div><p>The font properties of the legend. If None (default), the current
<a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">matplotlib.rcParams</span></code></a> will be used.</p>
</div></blockquote>
<p><strong>fontsize</strong> : int or float or {‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’}</p>
<blockquote>
<div><p>Controls the font size of the legend. If the value is numeric the
size will be the absolute font size in points. String values are
relative to the current default font size. This argument is only
used if <code class="xref py py-obj docutils literal"><span class="pre">prop</span></code> is not specified.</p>
</div></blockquote>
<p><strong>numpoints</strong> : None or int</p>
<blockquote>
<div><p>The number of marker points in the legend when creating a legend
entry for a line/<a class="reference internal" href="_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D" title="matplotlib.lines.Line2D"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.lines.Line2D</span></code></a>.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.numpoints</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>scatterpoints</strong> : None or int</p>
<blockquote>
<div><p>The number of marker points in the legend when creating a legend
entry for a scatter plot/
<a class="reference internal" href="collections_api.html#matplotlib.collections.PathCollection" title="matplotlib.collections.PathCollection"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.collections.PathCollection</span></code></a>.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.scatterpoints</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>scatteryoffsets</strong> : iterable of floats</p>
<blockquote>
<div><p>The vertical offset (relative to the font size) for the markers
created for a scatter plot legend entry. 0.0 is at the base the
legend text, and 1.0 is at the top. To draw all markers at the
same height, set to <code class="docutils literal"><span class="pre">[0.5]</span></code>. Default <code class="docutils literal"><span class="pre">[0.375,</span> <span class="pre">0.5,</span> <span class="pre">0.3125]</span></code>.</p>
</div></blockquote>
<p><strong>markerscale</strong> : None or int or float</p>
<blockquote>
<div><p>The relative size of legend markers compared with the originally
drawn ones. Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from
the <code class="docutils literal"><span class="pre">legend.markerscale</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>markerfirst</strong> : bool</p>
<blockquote>
<div><p>If <em>True</em>, legend marker is placed to the left of the legend label.
If <em>False</em>, legend marker is placed to the right of the legend
label.
Default is <em>True</em>.</p>
</div></blockquote>
<p><strong>frameon</strong> : None or bool</p>
<blockquote>
<div><p>Control whether the legend should be drawn on a patch (frame).
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.frameon</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>fancybox</strong> : None or bool</p>
<blockquote>
<div><p>Control whether round edges should be enabled around
the <a class="reference internal" href="_as_gen/matplotlib.patches.FancyBboxPatch.html#matplotlib.patches.FancyBboxPatch" title="matplotlib.patches.FancyBboxPatch"><code class="xref py py-class docutils literal"><span class="pre">FancyBboxPatch</span></code></a> which
makes up the legend’s background.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.fancybox</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>shadow</strong> : None or bool</p>
<blockquote>
<div><p>Control whether to draw a shadow behind the legend.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.shadow</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>framealpha</strong> : None or float</p>
<blockquote>
<div><p>Control the alpha transparency of the legend’s background.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.framealpha</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.
If shadow is activated and framealpha is <code class="docutils literal"><span class="pre">None</span></code> the
default value is being ignored.</p>
</div></blockquote>
<p><strong>facecolor</strong> : None or “inherit” or a color spec</p>
<blockquote>
<div><p>Control the legend’s background color.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.facecolor</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.
If <code class="docutils literal"><span class="pre">"inherit"</span></code>, it will take the <code class="docutils literal"><span class="pre">axes.facecolor</span></code>
<a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>edgecolor</strong> : None or “inherit” or a color spec</p>
<blockquote>
<div><p>Control the legend’s background patch edge color.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.edgecolor</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.
If <code class="docutils literal"><span class="pre">"inherit"</span></code>, it will take the <code class="docutils literal"><span class="pre">axes.edgecolor</span></code>
<a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>mode</strong> : {“expand”, None}</p>
<blockquote>
<div><p>If <code class="xref py py-obj docutils literal"><span class="pre">mode</span></code> is set to <code class="docutils literal"><span class="pre">"expand"</span></code> the legend will be horizontally
expanded to fill the axes area (or <code class="xref py py-obj docutils literal"><span class="pre">bbox_to_anchor</span></code> if defines
the legend’s size).</p>
</div></blockquote>
<p><strong>bbox_transform</strong> : None or <a class="reference internal" href="transformations.html#matplotlib.transforms.Transform" title="matplotlib.transforms.Transform"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.transforms.Transform</span></code></a></p>
<blockquote>
<div><p>The transform for the bounding box (<code class="xref py py-obj docutils literal"><span class="pre">bbox_to_anchor</span></code>). For a value
of <code class="docutils literal"><span class="pre">None</span></code> (default) the Axes’
<code class="xref py py-data docutils literal"><span class="pre">transAxes</span></code> transform will be used.</p>
</div></blockquote>
<p><strong>title</strong> : str or None</p>
<blockquote>
<div><p>The legend’s title. Default is no title (<code class="docutils literal"><span class="pre">None</span></code>).</p>
</div></blockquote>
<p><strong>borderpad</strong> : float or None</p>
<blockquote>
<div><p>The fractional whitespace inside the legend border.
Measured in font-size units.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.borderpad</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>labelspacing</strong> : float or None</p>
<blockquote>
<div><p>The vertical space between the legend entries.
Measured in font-size units.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.labelspacing</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>handlelength</strong> : float or None</p>
<blockquote>
<div><p>The length of the legend handles.
Measured in font-size units.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.handlelength</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>handletextpad</strong> : float or None</p>
<blockquote>
<div><p>The pad between the legend handle and text.
Measured in font-size units.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.handletextpad</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>borderaxespad</strong> : float or None</p>
<blockquote>
<div><p>The pad between the axes and legend border.
Measured in font-size units.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.borderaxespad</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>columnspacing</strong> : float or None</p>
<blockquote>
<div><p>The spacing between columns.
Measured in font-size units.
Default is <code class="docutils literal"><span class="pre">None</span></code> which will take the value from the
<code class="docutils literal"><span class="pre">legend.columnspacing</span></code> <a class="reference internal" href="matplotlib_configuration_api.html#matplotlib.rcParams" title="matplotlib.rcParams"><code class="xref py py-data docutils literal"><span class="pre">rcParam</span></code></a>.</p>
</div></blockquote>
<p><strong>handler_map</strong> : dict or None</p>
<blockquote class="last">
<div><p>The custom dictionary mapping instances or types to a legend
handler. This <code class="xref py py-obj docutils literal"><span class="pre">handler_map</span></code> updates the default handler map
found at <a class="reference internal" href="#matplotlib.legend.Legend.get_legend_handler_map" title="matplotlib.legend.Legend.get_legend_handler_map"><code class="xref py py-func docutils literal"><span class="pre">matplotlib.legend.Legend.get_legend_handler_map()</span></code></a>.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Users can specify any arbitrary location for the legend using the
<em>bbox_to_anchor</em> keyword argument. bbox_to_anchor can be an instance
of BboxBase(or its derivatives) or a tuple of 2 or 4 floats.
See <a class="reference internal" href="#matplotlib.legend.Legend.set_bbox_to_anchor" title="matplotlib.legend.Legend.set_bbox_to_anchor"><code class="xref py py-meth docutils literal"><span class="pre">set_bbox_to_anchor()</span></code></a> for more detail.</p>
<p>The legend location can be specified by setting <em>loc</em> with a tuple of
2 floats, which is interpreted as the lower-left corner of the legend
in the normalized axes coordinate.</p>
<dl class="attribute">
<dt id="matplotlib.legend.Legend.codes">
<code class="descname">codes</code><em class="property"> = {'best': 0, 'center': 10, 'center left': 6, 'center right': 7, 'lower center': 8, 'lower left': 3, 'lower right': 4, 'right': 5, 'upper center': 9, 'upper left': 2, 'upper right': 1}</em><a class="headerlink" href="#matplotlib.legend.Legend.codes" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.contains">
<code class="descname">contains</code><span class="sig-paren">(</span><em>event</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.contains" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.draggable">
<code class="descname">draggable</code><span class="sig-paren">(</span><em>state=None</em>, <em>use_blit=False</em>, <em>update='loc'</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.draggable" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the draggable state – if state is</p>
<blockquote>
<div><ul class="simple">
<li>None : toggle the current state</li>
<li>True : turn draggable on</li>
<li>False : turn draggable off</li>
</ul>
</div></blockquote>
<p>If draggable is on, you can drag the legend on the canvas with
the mouse. The DraggableLegend helper instance is returned if
draggable is on.</p>
<p>The update parameter control which parameter of the legend changes
when dragged. If update is “loc”, the <em>loc</em> parameter of the legend
is changed. If “bbox”, the <em>bbox_to_anchor</em> parameter is changed.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.draw">
<code class="descname">draw</code><span class="sig-paren">(</span><em>renderer</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.draw" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw everything that belongs to the legend</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.draw_frame">
<code class="descname">draw_frame</code><span class="sig-paren">(</span><em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.draw_frame" title="Permalink to this definition">¶</a></dt>
<dd><p>b is a boolean. Set draw frame to b</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_bbox_to_anchor">
<code class="descname">get_bbox_to_anchor</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_bbox_to_anchor" title="Permalink to this definition">¶</a></dt>
<dd><p>return the bbox that the legend will be anchored</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_children">
<code class="descname">get_children</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_children" title="Permalink to this definition">¶</a></dt>
<dd><p>return a list of child artists</p>
</dd></dl>
<dl class="classmethod">
<dt id="matplotlib.legend.Legend.get_default_handler_map">
<em class="property">classmethod </em><code class="descname">get_default_handler_map</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_default_handler_map" title="Permalink to this definition">¶</a></dt>
<dd><p>A class method that returns the default handler map.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_frame">
<code class="descname">get_frame</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_frame" title="Permalink to this definition">¶</a></dt>
<dd><p>return the Rectangle instance used to frame the legend</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_frame_on">
<code class="descname">get_frame_on</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_frame_on" title="Permalink to this definition">¶</a></dt>
<dd><p>Get whether the legend box patch is drawn</p>
</dd></dl>
<dl class="staticmethod">
<dt id="matplotlib.legend.Legend.get_legend_handler">
<em class="property">static </em><code class="descname">get_legend_handler</code><span class="sig-paren">(</span><em>legend_handler_map</em>, <em>orig_handle</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_legend_handler" title="Permalink to this definition">¶</a></dt>
<dd><p>return a legend handler from <em>legend_handler_map</em> that
corresponds to <em>orig_handler</em>.</p>
<p><em>legend_handler_map</em> should be a dictionary object (that is
returned by the get_legend_handler_map method).</p>
<p>It first checks if the <em>orig_handle</em> itself is a key in the
<em>legend_hanler_map</em> and return the associated value.
Otherwise, it checks for each of the classes in its
method-resolution-order. If no matching key is found, it
returns None.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_legend_handler_map">
<code class="descname">get_legend_handler_map</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_legend_handler_map" title="Permalink to this definition">¶</a></dt>
<dd><p>return the handler map.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_lines">
<code class="descname">get_lines</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>return a list of lines.Line2D instances in the legend</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_patches">
<code class="descname">get_patches</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_patches" title="Permalink to this definition">¶</a></dt>
<dd><p>return a list of patch instances in the legend</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_texts">
<code class="descname">get_texts</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_texts" title="Permalink to this definition">¶</a></dt>
<dd><p>return a list of text.Text instance in the legend</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_title">
<code class="descname">get_title</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_title" title="Permalink to this definition">¶</a></dt>
<dd><p>return Text instance for the legend title</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.get_window_extent">
<code class="descname">get_window_extent</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.get_window_extent" title="Permalink to this definition">¶</a></dt>
<dd><p>return a extent of the legend</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.set_bbox_to_anchor">
<code class="descname">set_bbox_to_anchor</code><span class="sig-paren">(</span><em>bbox</em>, <em>transform=None</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.set_bbox_to_anchor" title="Permalink to this definition">¶</a></dt>
<dd><p>set the bbox that the legend will be anchored.</p>
<p><em>bbox</em> can be a BboxBase instance, a tuple of [left, bottom,
width, height] in the given transform (normalized axes
coordinate if None), or a tuple of [left, bottom] where the
width and height will be assumed to be zero.</p>
</dd></dl>
<dl class="classmethod">
<dt id="matplotlib.legend.Legend.set_default_handler_map">
<em class="property">classmethod </em><code class="descname">set_default_handler_map</code><span class="sig-paren">(</span><em>handler_map</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.set_default_handler_map" title="Permalink to this definition">¶</a></dt>
<dd><p>A class method to set the default handler map.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.set_frame_on">
<code class="descname">set_frame_on</code><span class="sig-paren">(</span><em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.set_frame_on" title="Permalink to this definition">¶</a></dt>
<dd><p>Set whether the legend box patch is drawn</p>
<p>ACCEPTS: [ <em>True</em> | <em>False</em> ]</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend.Legend.set_title">
<code class="descname">set_title</code><span class="sig-paren">(</span><em>title</em>, <em>prop=None</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.set_title" title="Permalink to this definition">¶</a></dt>
<dd><p>set the legend title. Fontproperties can be optionally set
with <em>prop</em> parameter.</p>
</dd></dl>
<dl class="classmethod">
<dt id="matplotlib.legend.Legend.update_default_handler_map">
<em class="property">classmethod </em><code class="descname">update_default_handler_map</code><span class="sig-paren">(</span><em>handler_map</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend.Legend.update_default_handler_map" title="Permalink to this definition">¶</a></dt>
<dd><p>A class method to update the default handler map.</p>
</dd></dl>
<dl class="attribute">
<dt id="matplotlib.legend.Legend.zorder">
<code class="descname">zorder</code><em class="property"> = 5</em><a class="headerlink" href="#matplotlib.legend.Legend.zorder" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-matplotlib.legend_handler">
<span id="matplotlib-legend-handler"></span><h2><a class="reference internal" href="#module-matplotlib.legend_handler" title="matplotlib.legend_handler"><code class="xref py py-mod docutils literal"><span class="pre">matplotlib.legend_handler</span></code></a><a class="headerlink" href="#module-matplotlib.legend_handler" title="Permalink to this headline">¶</a></h2>
<p>This module defines default legend handlers.</p>
<p>It is strongly encouraged to have read the <a class="reference internal" href="../tutorials/intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py"><span class="std std-ref">legend guide</span></a> before this documentation.</p>
<p>Legend handlers are expected to be a callable object with a following
signature.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">legend_handler</span><span class="p">(</span><span class="n">legend</span><span class="p">,</span> <span class="n">orig_handle</span><span class="p">,</span> <span class="n">fontsize</span><span class="p">,</span> <span class="n">handlebox</span><span class="p">)</span>
</pre></div>
</div>
<p>Where <em>legend</em> is the legend itself, <em>orig_handle</em> is the original
plot, <em>fontsize</em> is the fontsize in pixels, and <em>handlebox</em> is a
OffsetBox instance. Within the call, you should create relevant
artists (using relevant properties from the <em>legend</em> and/or
<em>orig_handle</em>) and add them into the handlebox. The artists needs to
be scaled according to the fontsize (note that the size is in pixel,
i.e., this is dpi-scaled value).</p>
<p>This module includes definition of several legend handler classes
derived from the base class (HandlerBase) with the following method:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">legend_artist</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">legend</span><span class="p">,</span> <span class="n">orig_handle</span><span class="p">,</span> <span class="n">fontsize</span><span class="p">,</span> <span class="n">handlebox</span><span class="p">):</span>
</pre></div>
</div>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerBase">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerBase</code><span class="sig-paren">(</span><em>xpad=0.0</em>, <em>ypad=0.0</em>, <em>update_func=None</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerBase" title="Permalink to this definition">¶</a></dt>
<dd><p>A Base class for default legend handlers.</p>
<p>The derived classes are meant to override <em>create_artists</em> method, which
has a following signature.:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">create_artists</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">legend</span><span class="p">,</span> <span class="n">orig_handle</span><span class="p">,</span>
<span class="n">xdescent</span><span class="p">,</span> <span class="n">ydescent</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="p">,</span> <span class="n">fontsize</span><span class="p">,</span>
<span class="n">trans</span><span class="p">):</span>
</pre></div>
</div>
<p>The overridden method needs to create artists of the given
transform that fits in the given dimension (xdescent, ydescent,
width, height) that are scaled by fontsize if necessary.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerBase.adjust_drawing_area">
<code class="descname">adjust_drawing_area</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerBase.adjust_drawing_area" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerBase.create_artists">
<code class="descname">create_artists</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em>, <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerBase.create_artists" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerBase.legend_artist">
<code class="descname">legend_artist</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>fontsize</em>, <em>handlebox</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerBase.legend_artist" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the artist that this HandlerBase generates for the given
original artist/handle.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>legend</strong> : <a class="reference internal" href="#matplotlib.legend.Legend" title="matplotlib.legend.Legend"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.legend.Legend</span></code></a> instance</p>
<blockquote>
<div><p>The legend for which these legend artists are being created.</p>
</div></blockquote>
<p><strong>orig_handle</strong> : <a class="reference internal" href="artist_api.html#matplotlib.artist.Artist" title="matplotlib.artist.Artist"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.artist.Artist</span></code></a> or similar</p>
<blockquote>
<div><p>The object for which these legend artists are being created.</p>
</div></blockquote>
<p><strong>fontsize</strong> : float or int</p>
<blockquote>
<div><p>The fontsize in pixels. The artists being created should
be scaled according to the given fontsize.</p>
</div></blockquote>
<p><strong>handlebox</strong> : <a class="reference internal" href="offsetbox_api.html#matplotlib.offsetbox.OffsetBox" title="matplotlib.offsetbox.OffsetBox"><code class="xref py py-class docutils literal"><span class="pre">matplotlib.offsetbox.OffsetBox</span></code></a> instance</p>
<blockquote class="last">
<div><p>The box which has been created to hold this legend entry’s
artists. Artists created in the <a class="reference internal" href="#matplotlib.legend_handler.HandlerBase.legend_artist" title="matplotlib.legend_handler.HandlerBase.legend_artist"><code class="xref py py-obj docutils literal"><span class="pre">legend_artist</span></code></a> method must
be added to this handlebox inside this method.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerBase.update_prop">
<code class="descname">update_prop</code><span class="sig-paren">(</span><em>legend_handle</em>, <em>orig_handle</em>, <em>legend</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerBase.update_prop" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerCircleCollection">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerCircleCollection</code><span class="sig-paren">(</span><em>yoffsets=None</em>, <em>sizes=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerCircleCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for <code class="xref py py-obj docutils literal"><span class="pre">CircleCollections</span></code>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerCircleCollection.create_collection">
<code class="descname">create_collection</code><span class="sig-paren">(</span><em>orig_handle</em>, <em>sizes</em>, <em>offsets</em>, <em>transOffset</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerCircleCollection.create_collection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerErrorbar">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerErrorbar</code><span class="sig-paren">(</span><em>xerr_size=0.5</em>, <em>yerr_size=None</em>, <em>marker_pad=0.3</em>, <em>numpoints=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerErrorbar" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for Errorbars.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerErrorbar.create_artists">
<code class="descname">create_artists</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em>, <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerErrorbar.create_artists" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerErrorbar.get_err_size">
<code class="descname">get_err_size</code><span class="sig-paren">(</span><em>legend</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerErrorbar.get_err_size" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerLine2D">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerLine2D</code><span class="sig-paren">(</span><em>marker_pad=0.3</em>, <em>numpoints=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerLine2D" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for <a class="reference internal" href="_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D" title="matplotlib.lines.Line2D"><code class="xref py py-obj docutils literal"><span class="pre">Line2D</span></code></a> instances.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>marker_pad</strong> : float</p>
<blockquote>
<div><p>Padding between points in legend entry.</p>
</div></blockquote>
<p><strong>numpoints</strong> : int</p>
<blockquote class="last">
<div><p>Number of points to show in legend entry.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Any other keyword arguments are given to <a class="reference internal" href="#matplotlib.legend_handler.HandlerNpoints" title="matplotlib.legend_handler.HandlerNpoints"><code class="xref py py-obj docutils literal"><span class="pre">HandlerNpoints</span></code></a>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerLine2D.create_artists">
<code class="descname">create_artists</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em>, <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerLine2D.create_artists" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerLineCollection">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerLineCollection</code><span class="sig-paren">(</span><em>marker_pad=0.3</em>, <em>numpoints=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerLineCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for <a class="reference internal" href="collections_api.html#matplotlib.collections.LineCollection" title="matplotlib.collections.LineCollection"><code class="xref py py-obj docutils literal"><span class="pre">LineCollection</span></code></a> instances.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>marker_pad</strong> : float</p>
<blockquote>
<div><p>Padding between points in legend entry.</p>
</div></blockquote>
<p><strong>numpoints</strong> : int</p>
<blockquote class="last">
<div><p>Number of points to show in legend entry.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Any other keyword arguments are given to <a class="reference internal" href="#matplotlib.legend_handler.HandlerNpoints" title="matplotlib.legend_handler.HandlerNpoints"><code class="xref py py-obj docutils literal"><span class="pre">HandlerNpoints</span></code></a>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerLineCollection.create_artists">
<code class="descname">create_artists</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em>, <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerLineCollection.create_artists" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerLineCollection.get_numpoints">
<code class="descname">get_numpoints</code><span class="sig-paren">(</span><em>legend</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerLineCollection.get_numpoints" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerNpoints">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerNpoints</code><span class="sig-paren">(</span><em>marker_pad=0.3</em>, <em>numpoints=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerNpoints" title="Permalink to this definition">¶</a></dt>
<dd><p>A legend handler that shows <em>numpoints</em> points in the legend entry.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>marker_pad</strong> : float</p>
<blockquote>
<div><p>Padding between points in legend entry.</p>
</div></blockquote>
<p><strong>numpoints</strong> : int</p>
<blockquote class="last">
<div><p>Number of points to show in legend entry.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Any other keyword arguments are given to <a class="reference internal" href="#matplotlib.legend_handler.HandlerBase" title="matplotlib.legend_handler.HandlerBase"><code class="xref py py-obj docutils literal"><span class="pre">HandlerBase</span></code></a>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerNpoints.get_numpoints">
<code class="descname">get_numpoints</code><span class="sig-paren">(</span><em>legend</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerNpoints.get_numpoints" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerNpoints.get_xdata">
<code class="descname">get_xdata</code><span class="sig-paren">(</span><em>legend</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerNpoints.get_xdata" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerNpointsYoffsets">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerNpointsYoffsets</code><span class="sig-paren">(</span><em>numpoints=None</em>, <em>yoffsets=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerNpointsYoffsets" title="Permalink to this definition">¶</a></dt>
<dd><p>A legend handler that shows <em>numpoints</em> in the legend, and allows them to
be individually offest in the y-direction.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>numpoints</strong> : int</p>
<blockquote>
<div><p>Number of points to show in legend entry.</p>
</div></blockquote>
<p><strong>yoffsets</strong> : array of floats</p>
<blockquote class="last">
<div><p>Length <em>numpoints</em> list of y offsets for each point in
legend entry.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Any other keyword arguments are given to <a class="reference internal" href="#matplotlib.legend_handler.HandlerNpoints" title="matplotlib.legend_handler.HandlerNpoints"><code class="xref py py-obj docutils literal"><span class="pre">HandlerNpoints</span></code></a>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerNpointsYoffsets.get_ydata">
<code class="descname">get_ydata</code><span class="sig-paren">(</span><em>legend</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerNpointsYoffsets.get_ydata" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerPatch">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerPatch</code><span class="sig-paren">(</span><em>patch_func=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerPatch" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for <a class="reference internal" href="_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch" title="matplotlib.patches.Patch"><code class="xref py py-obj docutils literal"><span class="pre">Patch</span></code></a> instances.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>patch_func</strong> : callable, optional</p>
<blockquote class="last">
<div><p>The function that creates the legend key artist.
<em>patch_func</em> should have the signature:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">patch_func</span><span class="p">(</span><span class="n">legend</span><span class="o">=</span><span class="n">legend</span><span class="p">,</span> <span class="n">orig_handle</span><span class="o">=</span><span class="n">orig_handle</span><span class="p">,</span>
<span class="n">xdescent</span><span class="o">=</span><span class="n">xdescent</span><span class="p">,</span> <span class="n">ydescent</span><span class="o">=</span><span class="n">ydescent</span><span class="p">,</span>
<span class="n">width</span><span class="o">=</span><span class="n">width</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="n">height</span><span class="p">,</span> <span class="n">fontsize</span><span class="o">=</span><span class="n">fontsize</span><span class="p">)</span>
</pre></div>
</div>
<p>Subsequently the created artist will have its <code class="docutils literal"><span class="pre">update_prop</span></code> method
called and the appropriate transform will be applied.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Any other keyword arguments are given to <a class="reference internal" href="#matplotlib.legend_handler.HandlerBase" title="matplotlib.legend_handler.HandlerBase"><code class="xref py py-obj docutils literal"><span class="pre">HandlerBase</span></code></a>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerPatch.create_artists">
<code class="descname">create_artists</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em>, <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerPatch.create_artists" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerPathCollection">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerPathCollection</code><span class="sig-paren">(</span><em>yoffsets=None</em>, <em>sizes=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerPathCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for <code class="xref py py-obj docutils literal"><span class="pre">PathCollections</span></code>, which are used by <a class="reference internal" href="_as_gen/matplotlib.axes.Axes.scatter.html#matplotlib.axes.Axes.scatter" title="matplotlib.axes.Axes.scatter"><code class="xref py py-obj docutils literal"><span class="pre">scatter</span></code></a>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerPathCollection.create_collection">
<code class="descname">create_collection</code><span class="sig-paren">(</span><em>orig_handle</em>, <em>sizes</em>, <em>offsets</em>, <em>transOffset</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerPathCollection.create_collection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerPolyCollection">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerPolyCollection</code><span class="sig-paren">(</span><em>xpad=0.0</em>, <em>ypad=0.0</em>, <em>update_func=None</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerPolyCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for <a class="reference internal" href="collections_api.html#matplotlib.collections.PolyCollection" title="matplotlib.collections.PolyCollection"><code class="xref py py-obj docutils literal"><span class="pre">PolyCollection</span></code></a> used in <a class="reference internal" href="_as_gen/matplotlib.axes.Axes.fill_between.html#matplotlib.axes.Axes.fill_between" title="matplotlib.axes.Axes.fill_between"><code class="xref py py-obj docutils literal"><span class="pre">fill_between</span></code></a> and <a class="reference internal" href="_as_gen/matplotlib.axes.Axes.stackplot.html#matplotlib.axes.Axes.stackplot" title="matplotlib.axes.Axes.stackplot"><code class="xref py py-obj docutils literal"><span class="pre">stackplot</span></code></a>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerPolyCollection.create_artists">
<code class="descname">create_artists</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em>, <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerPolyCollection.create_artists" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerRegularPolyCollection">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerRegularPolyCollection</code><span class="sig-paren">(</span><em>yoffsets=None</em>, <em>sizes=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerRegularPolyCollection" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for <code class="xref py py-obj docutils literal"><span class="pre">RegularPolyCollections</span></code>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerRegularPolyCollection.create_artists">
<code class="descname">create_artists</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em>, <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerRegularPolyCollection.create_artists" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerRegularPolyCollection.create_collection">
<code class="descname">create_collection</code><span class="sig-paren">(</span><em>orig_handle</em>, <em>sizes</em>, <em>offsets</em>, <em>transOffset</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerRegularPolyCollection.create_collection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerRegularPolyCollection.get_numpoints">
<code class="descname">get_numpoints</code><span class="sig-paren">(</span><em>legend</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerRegularPolyCollection.get_numpoints" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerRegularPolyCollection.get_sizes">
<code class="descname">get_sizes</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerRegularPolyCollection.get_sizes" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerRegularPolyCollection.update_prop">
<code class="descname">update_prop</code><span class="sig-paren">(</span><em>legend_handle</em>, <em>orig_handle</em>, <em>legend</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerRegularPolyCollection.update_prop" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerStem">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerStem</code><span class="sig-paren">(</span><em>marker_pad=0.3</em>, <em>numpoints=None</em>, <em>bottom=None</em>, <em>yoffsets=None</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerStem" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for plots produced by <a class="reference internal" href="_as_gen/matplotlib.axes.Axes.stem.html#matplotlib.axes.Axes.stem" title="matplotlib.axes.Axes.stem"><code class="xref py py-obj docutils literal"><span class="pre">stem</span></code></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>marker_pad</strong> : float</p>
<blockquote>
<div><p>Padding between points in legend entry. Default is 0.3.</p>
</div></blockquote>
<p><strong>numpoints</strong> : int, optional</p>
<blockquote>
<div><p>Number of points to show in legend entry.</p>
</div></blockquote>
<p><strong>bottom</strong> : float, optional</p>
<p><strong>yoffsets</strong> : array of floats, optional</p>
<blockquote class="last">
<div><p>Length <em>numpoints</em> list of y offsets for each point in
legend entry.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Any other keyword arguments are given to <a class="reference internal" href="#matplotlib.legend_handler.HandlerNpointsYoffsets" title="matplotlib.legend_handler.HandlerNpointsYoffsets"><code class="xref py py-obj docutils literal"><span class="pre">HandlerNpointsYoffsets</span></code></a>.</p>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerStem.create_artists">
<code class="descname">create_artists</code><span class="sig-paren">(</span><em>legend</em>, <em>orig_handle</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em>, <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerStem.create_artists" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.legend_handler.HandlerStem.get_ydata">
<code class="descname">get_ydata</code><span class="sig-paren">(</span><em>legend</em>, <em>xdescent</em>, <em>ydescent</em>, <em>width</em>, <em>height</em>, <em>fontsize</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerStem.get_ydata" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.legend_handler.HandlerTuple">
<em class="property">class </em><code class="descclassname">matplotlib.legend_handler.</code><code class="descname">HandlerTuple</code><span class="sig-paren">(</span><em>ndivide=1</em>, <em>pad=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#matplotlib.legend_handler.HandlerTuple" title="Permalink to this definition">¶</a></dt>
<dd><p>Handler for Tuple.</p>
<p>Additional kwargs are passed through to <a class="reference internal" href="#matplotlib.legend_handler.HandlerBase" title="matplotlib.legend_handler.HandlerBase"><code class="xref py py-obj docutils literal"><span class="pre">HandlerBase</span></code></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ndivide</strong> : int, optional</p>
<blockquote>
<div><p>The number of sections to divide the legend area into. If None,
use the length of the input tuple. Default is 1.</p>
</div></blockquote>
<p><strong>pad</strong> : float, optional</p>
<blockquote class="last">
<div><p>If None, fall back to <code class="docutils literal"><span class="pre">legend.borderpad</span></code> as the default.
In units of fraction of font size. Default is None.</p>
</div></blockquote>
</td>
</tr>