Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/matplotlib/__pycache__/legend.cpython-37.pyc

568 lines
35 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
U<>]m<><00>@sndZddlZddlZddlmZddlmZddlmZmZddlm Z m
Z
ddl m Z m Z mZddlmZdd lmZdd
lmZmZmZmZdd lmZmZmZmZmZdd lmZm Z m!Z!dd lm"Z"m#Z#ddl$m%Z%m&Z&m'Z'm(Z(ddl$m)Z)ddl*m+Z+m,Z,m-Z-ddl.m/Z/Gdd<14>de)<29>Z0dZ1ej2j3e1d<16>Gdd<18>de <09>Z4d dd<1A>Z5d!dd<1C>Z6ddd<1D>dd<1F>Z7dS)"aO
The legend module defines the Legend class, which is responsible for
drawing legends associated with axes and/or figures.
.. important::
It is unlikely that you would ever create a Legend instance
manually. Most users would normally create a legend via the
:meth:`~matplotlib.axes.Axes.legend` function. For more details on legends
there is also a :doc:`legend guide </tutorials/intermediate/legend_guide>`.
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
:mod:`~matplotlib.legend_handler` 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 :doc:`legend guide </tutorials/intermediate/legend_guide>` for more
information.
<EFBFBD>N)<01>cbook)<01>rcParams)r<00> docstring)<02>Artist<73>allow_rasterization)<03> silent_list<73> is_hashable<6C>warn_deprecated)<01>FontProperties)<01>Line2D)<04>Patch<63> Rectangle<6C>Shadow<6F>FancyBboxPatch)<05>LineCollection<6F>RegularPolyCollection<6F>CircleCollection<6F>PathCollection<6F>PolyCollection)<03>Bbox<6F>BboxBase<73>TransformedBbox)<02>BboxTransformTo<54>BboxTransformFrom)<04>HPacker<65>VPacker<65>TextArea<65> DrawingArea)<01>DraggableOffsetBox)<03>ErrorbarContainer<65> BarContainer<65> StemContainer<65>)<01>legend_handlerc@s6eZdZddd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Zd S)<0F>DraggableLegendF<64>loccCs:||_|dkr||_n td|<00><01>tj|||j|d<03>dS)a<>
Wrapper around a `.Legend` to support mouse dragging.
Parameters
----------
legend : `.Legend`
The `.Legend` instance to wrap.
use_blit : bool, optional
Use blitting for faster image composition. For details see
:ref:`func-animation`.
update : {'loc', 'bbox'}, optional
If "loc", update the *loc* parameter of the legend upon finalizing.
If "bbox", update the *bbox_to_anchor* parameter.
)r%<00>bboxz'update parameter '%s' is not supported.)<01>use_blitN)<06>legend<6E>_update<74>
ValueErrorr<00>__init__<5F> _legend_box)<04>selfr(r'<00>update<74>r/<00>9/tmp/pip-install-i8dhxrtk/matplotlib/matplotlib/legend.pyr+2s zDraggableLegend.__init__cCs |j<00>|<02>S)N)r(<00>contains)r-r(Zevtr/r/r0<00> artist_pickerLszDraggableLegend.artist_pickercCsF|<00><00>}|jdkr|<00>|<01>n$|jdkr4|<00>|<01>ntd|j<00><01>dS)Nr%r&z'update parameter '%s' is not supported.)Zget_loc_in_canvasr)<00> _update_loc<6F>_update_bbox_to_anchor<6F> RuntimeErrorr.)r-<00> loc_in_canvasr/r/r0<00>finalize_offsetOs
 
 zDraggableLegend.finalize_offsetcCsR|j<00><01>}|jdks|jdkr4|j<00>d<00>|j<00><01>}t|<02>}t|<03>|<01><01>|j_dS)Nr) r(<00>get_bbox_to_anchor<6F>width<74>height<68>set_bbox_to_anchorr<00>tuple<6C>transform_point<6E>_loc)r-r6r&Z_bbox_transformr/r/r0r3Zs
 
zDraggableLegend._update_loccCs$|jjj}|<02>|<01>}|j<00>|<03>dS)N)r(<00>axesZ transAxesr=r;)r-r6<00>trZ loc_in_bboxr/r/r0r4hs

z&DraggableLegend._update_bbox_to_anchorN)Fr%)<08>__name__<5F>
__module__<EFBFBD> __qualname__r+r2r7r3r4r/r/r/r0r$1s

 r$a<>
loc : str or pair of floats, default: :rc:`legend.loc` ('best' for axes, 'upper right' for figures)
The location of the legend.
The strings
``'upper left', 'upper right', 'lower left', 'lower right'``
place the legend at the corresponding corner of the axes/figure.
The strings
``'upper center', 'lower center', 'center left', 'center right'``
place the legend at the center of the corresponding edge of the
axes/figure.
The string ``'center'`` places the legend at the center of the axes/figure.
The string ``'best'`` places the legend at the location, among the nine
locations defined so far, with the minimum overlap with other drawn
artists. This option can be quite slow for plots with large amounts of
data; your plotting speed may benefit from providing a specific location.
The location can also be a 2-tuple giving the coordinates of the lower-left
corner of the legend in axes coordinates (in which case *bbox_to_anchor*
will be ignored).
For back-compatibility, ``'center right'`` (but no other location) can also
be spelled ``'right'``, and each "string" locations can also be given as a
numeric value:
=============== =============
Location String Location Code
=============== =============
'best' 0
'upper right' 1
'upper left' 2
'lower left' 3
'lower right' 4
'right' 5
'center left' 6
'center right' 7
'lower center' 8
'upper center' 9
'center' 10
=============== =============
bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*.
Defaults to `axes.bbox` (if called as a method to `.Axes.legend`) or
`figure.bbox` (if `.Figure.legend`). This argument allows arbitrary
placement of the legend.
Bbox coordinates are interpreted in the coordinate system given by
`bbox_transform`, with the default transform
Axes or Figure coordinates, depending on which ``legend`` is called.
If a 4-tuple or `.BboxBase` is given, then it specifies the bbox
``(x, y, width, height)`` that the legend is placed in.
To put the legend in the best location in the bottom right
quadrant of the axes (or figure)::
loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
A 2-tuple ``(x, y)`` places the corner of the legend specified by *loc* at
x, y. For example, to put the legend's upper right-hand corner in the
center of the axes (or figure) the following keywords can be used::
loc='upper right', bbox_to_anchor=(0.5, 0.5)
ncol : integer
The number of columns that the legend has. Default is 1.
prop : None or :class:`matplotlib.font_manager.FontProperties` or dict
The font properties of the legend. If None (default), the current
:data:`matplotlib.rcParams` will be used.
fontsize : int or float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
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 `prop` is not specified.
numpoints : None or int
The number of marker points in the legend when creating a legend
entry for a `.Line2D` (line).
Default is ``None``, which will take the value from
:rc:`legend.numpoints`.
scatterpoints : None or int
The number of marker points in the legend when creating
a legend entry for a `.PathCollection` (scatter plot).
Default is ``None``, which will take the value from
:rc:`legend.scatterpoints`.
scatteryoffsets : iterable of floats
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 ``[0.5]``. Default is ``[0.375, 0.5, 0.3125]``.
markerscale : None or int or float
The relative size of legend markers compared with the originally
drawn ones.
Default is ``None``, which will take the value from
:rc:`legend.markerscale`.
markerfirst : bool
If *True*, legend marker is placed to the left of the legend label.
If *False*, legend marker is placed to the right of the legend
label.
Default is *True*.
frameon : None or bool
Control whether the legend should be drawn on a patch
(frame).
Default is ``None``, which will take the value from
:rc:`legend.frameon`.
fancybox : None or bool
Control whether round edges should be enabled around the
:class:`~matplotlib.patches.FancyBboxPatch` which makes up the
legend's background.
Default is ``None``, which will take the value from
:rc:`legend.fancybox`.
shadow : None or bool
Control whether to draw a shadow behind the legend.
Default is ``None``, which will take the value from
:rc:`legend.shadow`.
framealpha : None or float
Control the alpha transparency of the legend's background.
Default is ``None``, which will take the value from
:rc:`legend.framealpha`. If shadow is activated and
*framealpha* is ``None``, the default value is ignored.
facecolor : None or "inherit" or a color spec
Control the legend's background color.
Default is ``None``, which will take the value from
:rc:`legend.facecolor`. If ``"inherit"``, it will take
:rc:`axes.facecolor`.
edgecolor : None or "inherit" or a color spec
Control the legend's background patch edge color.
Default is ``None``, which will take the value from
:rc:`legend.edgecolor` If ``"inherit"``, it will take
:rc:`axes.edgecolor`.
mode : {"expand", None}
If `mode` is set to ``"expand"`` the legend will be horizontally
expanded to fill the axes area (or `bbox_to_anchor` if defines
the legend's size).
bbox_transform : None or :class:`matplotlib.transforms.Transform`
The transform for the bounding box (`bbox_to_anchor`). For a value
of ``None`` (default) the Axes'
:data:`~matplotlib.axes.Axes.transAxes` transform will be used.
title : str or None
The legend's title. Default is no title (``None``).
title_fontsize: str or None
The fontsize of the legend's title. Default is the default fontsize.
borderpad : float or None
The fractional whitespace inside the legend border.
Measured in font-size units.
Default is ``None``, which will take the value from
:rc:`legend.borderpad`.
labelspacing : float or None
The vertical space between the legend entries.
Measured in font-size units.
Default is ``None``, which will take the value from
:rc:`legend.labelspacing`.
handlelength : float or None
The length of the legend handles.
Measured in font-size units.
Default is ``None``, which will take the value from
:rc:`legend.handlelength`.
handletextpad : float or None
The pad between the legend handle and text.
Measured in font-size units.
Default is ``None``, which will take the value from
:rc:`legend.handletextpad`.
borderaxespad : float or None
The pad between the axes and legend border.
Measured in font-size units.
Default is ``None``, which will take the value from
:rc:`legend.borderaxespad`.
columnspacing : float or None
The spacing between columns.
Measured in font-size units.
Default is ``None``, which will take the value from
:rc:`legend.columnspacing`.
handler_map : dict or None
The custom dictionary mapping instances or types to a legend
handler. This `handler_map` updates the default handler map
found at :func:`matplotlib.legend.Legend.get_legend_handler_map`.
)<01>_legend_kw_docc@s<>eZdZdZdddddddd d
d d d <0A> ZdZdd<0F>ZejdWdd<13><01>Z dd<15>Z
dd<17>Z dd<19>Z e e e <0B>Zdd<1B>Zedd<1D><00>ZdXdd<1F>Zee<14><15>ee<14><17>ee<14><19>ee<14><1B>ee<14><1D>ee<14><1F>e e<14>!<21>e"ejej#d <20>e$e<14>%<25>e&e<14>'<27>e(e<14>)<29>i Z*e+d!d"<22><00>Z,e+d#d$<24><00>Z-e+d%d&<26><00>Z.d'd(<28>Z/e0d)d*<2A><00>Z1dYd+d,<2C>Z2d-d.<2E>Z3d/d0<64>Z4d1d2<64>Z5d3d4<64>Z6d5d6<64>Z7d7d8<64>Z8d9d:<3A>Z9dZd;d<<3C>Z:d=d><3E>Z;d[d?d@<40>Z<dAdB<64>Z=dCdD<64>Z>dEdF<64>Z?dGdH<64>Z@d\dIdJ<64>ZAdKdL<64>ZBd]dMdN<64>ZCdOdP<64>ZDd^dSdT<64>ZEdUdV<64>ZFdS)_<>Legendz6
Place a legend on the axes at location loc.
rr"<00><00><00><00><00><00><00><00> <00>
) <0B>bestz upper rightz
upper leftz
lower leftz lower right<68>rightz center leftz center rightz lower centerz upper center<65>centercCsdS)NrEr/)r-r/r/r0<00>__str__UszLegend.__str__NTc , Cs~ddlm} ddlm}!t<04>|<00>|
dkrR| dk r@t| d<05>|_q<>ttdd<05>|_n6t |
t
<EFBFBD>r<>tf|
<EFBFBD>|_d|
kr<>|j<07> td<00>n|
|_|j<07> <0C>|_ g|_g|_d|_||_t<12>}"x:dD]2}#|"|#dkr<>td |#}$n|"|#}$t||#|$<24>q<>W~"gg}%}&xXt||<02>D]J\}'}(t |'t<15><02>r:|'<27>d
<EFBFBD><01>r:t<17>d <0B>|(|'<27><02>n|%<25>|'<27>|&<26>|(<28><00>qW|%|&}}t|<02>}t|<02>d k<00>rxd }||_|jdk<01>r<>td|<00><01>| dk<08>r<>t <20>!dddg<03>|_"n t <20>#| <09>|_"|j$t|j"<22>d })t <20>%|j"|)<29>d|j$<24>|_"d|_&t || <20><02>rd|_'||_(|<00>)|j*<2A>n&t ||!<21><02>r8d|_'|<00>)|<01>nt+d<14><01>||_,|dk|_-|dk<08>rxtd}|j'<27>sx|dk<06>rxd}t |t<15><02>r<>||j.k<07>r<>|j'<27>r<>tj/dd<19>|d<1A>0|j.<2E><01>d<1B>d}n"tj/dd<1C>|d<1A>0|j.<2E><01>d<1B>d }n
|j.|}|j'<27>s|dk<02>rtj/ddd<1B>d }||_1|<00>2||<1D>|dk<08>r2td}|dk<02>rDtd }|dk<08>rVtd!}|dk<02>rhtd"}t3d#d$d$|||j dd%<25>|_4|dk<08>r<>td&}|<15>r<>|j4j5d'dd(d)<29>n|j4j5d*dd+<2B>|<00>6|j4<6A>||_7|dk<08>r<>td,|_7|<00>8|||<07>|dk<08>r&|<16>r|<00>9<EFBFBD><00>:d <0A>n|<00>9<EFBFBD><00>:td-<00>n|<00>9<EFBFBD><00>:|<19>|j-}*|<00>;|<04>|*|_-|dk<08>r\td.}t|d<05>}+|j<||+d/<2F>d|_=dS)0aC
Parameters
----------
parent : `~matplotlib.axes.Axes` or `.Figure`
The artist that contains the legend.
handles : sequence of `.Artist`
A list of Artists (lines, patches) to be added to the legend.
labels : sequence of strings
A list of labels to show next to the artists. The length of handles
and labels should be the same. If they are not, they are truncated
to the smaller of both lengths.
Other Parameters
----------------
%(_legend_kw_doc)s
Notes
-----
Users can specify any arbitrary location for the legend using the
*bbox_to_anchor* keyword argument. bbox_to_anchor can be an instance
of BboxBase(or its derivatives) or a tuple of 2 or 4 floats.
See :meth:`set_bbox_to_anchor` for more detail.
The legend location can be specified by setting *loc* with a tuple of
2 floats, which is interpreted as the lower-left corner of the legend
in the normalized axes coordinate.
r)<01>Axes)<01>FigureN)<01>sizezlegend.fontsizerU) <0B> numpoints<74> markerscale<6C>shadow<6F> columnspacing<6E> scatterpoints<74> handleheight<68> borderpad<61> labelspacing<6E> handlelength<74> handletextpad<61> borderaxespadzlegend.<2E>_zVThe handle {!r} has a label of {!r} which cannot be automatically added to the legend.rFr"z numpoints must be > 0; it was %dg<00>?g<00>?g<00>?TFz,Legend needs either Axes or Figure as parentz
legend.loc)rrOz upper rightz3.1zuUnrecognized location {!r}. Falling back on 'best'; valid locations are
{}
This will raise an exception %(removal)s.z
)<01>messagez}Unrecognized location {!r}. Falling back on 'upper right'; valid locations are
{}
'This will raise an exception %(removal)s.z<>Automatic legend placement (loc='best') not implemented for figure legend. Falling back on 'upper right'. This will raise an exception %(removal)s.zlegend.facecolorZinheritzaxes.facecolorzlegend.edgecolorzaxes.edgecolor)ggg<00>?)Zxyr9r:<00> facecolor<6F> edgecolorZmutation_scaleZsnapzlegend.fancybox<6F>roundg<64><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?)<02>padZ rounding_sizeZsquare)rfzlegend.frameonzlegend.framealphazlegend.title_fontsize)<01>prop)>Zmatplotlib.axesrSZmatplotlib.figurerTrr+r
rgr<00>
isinstance<EFBFBD>dictZset_sizeZget_size_in_points<74> _fontsize<7A>texts<74> legendHandles<65>_legend_title_box<6F>_custom_handler_map<61>locals<6C>setattr<74>zip<69>str<74>
startswithr<00>_warn_external<61>format<61>append<6E>list<73>len<65>_ncolrVr*<00>np<6E>arrayZ_scatteryoffsetsZasarrayrZZtiler,<00>isaxesr?<00>
set_figure<EFBFBD>figure<72> TypeError<6F>parent<6E>_loc_used_default<6C>codesr <00>join<69>_moder;r<00> legendPatchZ set_boxstyle<6C>_set_artist_props<70>
_drawFrame<EFBFBD>_init_legend_box<6F> get_frameZ set_alpha<68>_set_loc<6F> set_title<6C>
_draggable),r-r<><00>handles<65>labelsr%rVrW<00> markerfirstrZZscatteryoffsetsrg<00>fontsizer\r]r^r[r_r`rY<00>ncol<6F>modeZfancyboxrX<00>titleZtitle_fontsizeZ
framealphardrcZbbox_to_anchorZbbox_transformZframeon<6F> handler_maprSrTZ locals_view<65>name<6D>valueZ_labZ_hand<6E>label<65>handleZreps<70>tmpZtpropr/r/r0r+Xs<>K  

  
 
 

  
    

  

 







 





zLegend.__init__cCs,|<01>|j<01>|jr|j|_|<01>|<00><05><00>dS)zF
Set the boilerplate props for artists added to axes.
N)r}r~r|r?Z set_transform<72> get_transform)r-<00>ar/r/r0r<>Vs zLegend._set_artist_propscCs$d|_||_d|_|j<03>|j<05>dS)NFT)r<><00> _loc_real<61>staler,Z
set_offset<EFBFBD> _findoffset)r-r%r/r/r0r<>aszLegend._set_loccCs|jS)N)r<>)r-r/r/r0<00>_get_locjszLegend._get_locc Cs<>|jdkr|<00>|||<05>\}}np|jtj<03><04>krZt<05>dd||<02>}|<00>|j||<00><08>|<05>\}}n4|j\} }
|<00><08>}|j |j
| |j |j |
}}||||fS)z%Helper function to locate the legend.r) r><00>_find_best_positionrEr<><00>valuesr<00> from_bounds<64>_get_anchored_bboxr8<00>x0r9<00>y0r:) r-r9r:<00>xdescent<6E>ydescent<6E>renderer<65>x<>yr&ZfxZfyr/r/r0r<>os

 
"zLegend._findoffsetcCs<>|<00><00>s dS|<01>d<02>|<01>|j<03>}|jdkrVd|j|j|}|j<07>|<00> <09>j
|<00>|j<07> |<01>}|j <0C> |j|j|j
|j<10>|j <0C>|<02>|jr<>|jr<>t|j dd<05>}|<05>|<01>|j <0C>|<01>|j<07>|<01>|<01>d<02>d|_dS)z+Draw everything that belongs to the legend.Nr()<01>expandrF<00><><EFBFBD><EFBFBD><EFBFBD>F)Z get_visibleZ
open_group<EFBFBD>points_to_pixelsrjr<>r`r\r,Z set_widthr8r9<00>get_window_extentr<74>Z
set_boundsr<EFBFBD>r<>r:Zset_mutation_scaler<65>rXr<00>drawZ close_groupr<70>)r-r<>r<>rfr&rXr/r/r0r<><00>s&
 
   
  
z Legend.drawcCs|dkr|jS|<01>|j<00>SdS)zm
Return the approximate height of the text. This is used to place
the legend handle.
N)rjr<>)r-r<>r/r/r0<00>_approx_text_height<68>szLegend._approx_text_height)Z update_funccCs|jS)zF
A class method that returns the default handler map.
)<01>_default_handler_map)<01>clsr/r/r0<00>get_default_handler_map<61>szLegend.get_default_handler_mapcCs
||_dS)z@
A class method to set the default handler map.
N)r<>)r<>r<>r/r/r0<00>set_default_handler_map<61>szLegend.set_default_handler_mapcCs|j<00>|<01>dS)zC
A class method to update the default handler map.
N)r<>r.)r<>r<>r/r/r0<00>update_default_handler_map<61>sz!Legend.update_default_handler_mapcCs.|<00><00>}|jr&|<01><02>}|<02>|j<01>|S|SdS)z)
Return the handler map.
N)r<>rn<00>copyr.)r-Zdefault_handler_mapZhmr/r/r0<00>get_legend_handler_map<61>s  zLegend.get_legend_handler_mapc CsZy||Sttfk
r YnXx2t|<01><01><03>D]"}y||Stk
rPYq0Xq0WdS)a
Return a legend handler from *legend_handler_map* that
corresponds to *orig_handler*.
*legend_handler_map* should be a dictionary object (that is
returned by the get_legend_handler_map method).
It first checks if the *orig_handle* itself is a key in the
*legend_handler_map* 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``.
N)r<00>KeyError<6F>type<70>mro)<03>legend_handler_map<61> orig_handleZ handle_typer/r/r0<00>get_legend_handler<65>s
zLegend.get_legend_handlerc s~<00>j<00>g}g}g}tdd<02>jd<03>}d<04><02><03><00>jd}<08><02><03><00>j|} <09><02><05>}
x<EFBFBD>t||<02>D]<5D>\} } <0C><02>|
| <0B>} | dkr<>t<08> d<07>
| <0B><01>|<05> d<06>q^t | |ddd <09>}t <0A>j<0E>| d
|d <0B>}|<04> |j<0F>|<05> | <0A><10>| <0B>|<0F><04>|<06> ||f<02>q^W|<06>rbt<11>jt|<06><01>}tt|<06>|<10>\}}||}|d g||g|}t<15>d gt<15>|<14>dd<0E>g<02>}t||<14>}ng}g}x<>|D]<5D>\}}<19><00><01>fdd<10>||||<00>D<00>}<1A><01>r<>|d<00><18>d <00>d<11>n|d<00><18>d <00>d<11><00><01>r<>dnd}|<17> td <0A>j<1B>||d<13><04><00>qpW<00>jdk<02>rdnd}<1C>j<1D>}td |d||d<16><05>_t d<17><01>_ t<1A>j!<21><00>j<1B>d<18>j <20>jgd<13><04>_"<22>j"<22>#<23>j$<24>|<04>_%|<05>_&dS)z<>
Initialize the legend_box. The legend_box is an instance of
the OffsetBox, which is packed with legend handles and
texts. Once packed, their location is calculated during the
drawing time.
<20>baseline<6E>left)ZverticalalignmentZhorizontalalignmentZfontpropertiesgffffff<66>?gffffff<66>?Nz<4E>Legend does not support {!r} instances.
A proxy artist may be used instead.
See: http://matplotlib.org/users/legend_guide.html#creating-artists-specifically-for-adding-to-the-legend-aka-proxy-artistsT)Z textpropsZmultilinebaselineZminimumdescentg)r9r:r<>r<>r"r<00><><EFBFBD><EFBFBD><EFBFBD>cs6g|].\}}td<00>j<01><00>r$||gn||gdd<02><04>qS)rr<>)rf<00>sep<65>children<65>align)rr_)<03>.0<EFBFBD>h<>t)r<>r<>r-r/r0<00>
<listcomp>Usz+Legend._init_legend_box.<locals>.<listcomp>FrP)rfr<>r<>r<>r<>Zfixed)rfr<>r<>r<>r<><00>rQ)'rjrirgr<>r[r<>rqr<>rrtrurvrrr^<00>_textZ legend_artist<73>minryrx<00>divmodrz<00> concatenateZcumsum<75> get_childrenZset_minimumdescentrr]r<>rYrZ_legend_handle_boxrmr\r,r}r~rkrl)r-r<>r<>r<>Z text_listZ handle_listZhandles_and_labelsZ
label_propZdescentr:r<>r<>Zlab<61>handlerZtextboxZ handleboxr<78>ZnrowsZ num_largecolZ num_smallcolZ rows_per_colZ
start_idxs<EFBFBD>colsZ columnboxZi0ZdiZ itemBoxes<65> alignmentr<74>r<>r/)r<>r<>r-r0r<><00>s|

   

  
 



zLegend._init_legend_boxcCsL|js
t<01>|j}g}g}g}x@|jD]6}t|t<05>s6t<01>|<05><06>}|<05><07>}|<07>|<06>}|<03> |<08>q$Wx`|j
D]V}t|t <0B>sxt<01>t|t <0C>r<>|<05> <0A>} |<02> |<05><0E><00>| <09><01>qf|<05><07>} |<02> |<05><06><00>| <09><01>qfWxD|jD]:}|<05><12>\} }
} } t| <0B>r<>x|
<EFBFBD>| <0B>D]} |<04> | <0A>q<>Wq<>Wyt<15>dd<02>|D<00><01>}Wn tk
<EFBFBD>r>t<15>g<00>}YnX||||gS)a{
Returns list of vertices and extents covered by the plot.
Returns a two long list.
First element is a list of (x, y) vertices (in
display-coordinates) covered by all the lines and line
collections, in the legend's handles.
Second element is a list of bounding boxes for all the patches in
the legend's handles.
cSsg|]
}|j<00>qSr/)<01>vertices)r<><00>lr/r/r0r<><00>sz,Legend._auto_legend_data.<locals>.<listcomp>)r|<00>AssertionErrorr<72><00>linesrhr <00>get_pathr<68>Ztransform_pathrv<00>patchesr r Zget_data_transformZget_bboxZ transformedZ get_extents<74> collectionsZ_prepare_pointsrx<00> transformrzr<>r*r{)r-<00>ax<61>bboxesr<73><00>offsetsr<73><00>pathZtransZtpathr<68>Z transOffsetZhoffsets<74>paths<68>offsetr<74>r/r/r0<00>_auto_legend_dataws8
 
 
 zLegend._auto_legend_datacCs|<00>|<01>dS)z^
Set draw frame to b.
Parameters
----------
b : bool
N)<01> set_frame_on)r-<00>br/r/r0<00>
draw_frame<EFBFBD>szLegend.draw_framecCs(g}|jr|<01>|j<00>|<01>|<00><02><00>|S)zReturn a list of child artists.)r,rvr<>)r-r<>r/r/r0r<><00>s
 zLegend.get_childrencCs|jS)zV
Return the `~.patches.Rectangle` instances used to frame the legend.
)r<>)r-r/r/r0r<><00>szLegend.get_framecCsdd<02>|jD<00>S)z:Return a list of `~.lines.Line2D` instances in the legend.cSsg|]}t|t<01>r|<01>qSr/)rhr )r<>r<>r/r/r0r<><00>sz$Legend.get_lines.<locals>.<listcomp>)rl)r-r/r/r0<00> get_lines<65>szLegend.get_linescCstddd<03>|jD<00><01>S)z;Return a list of `~.patches.Patch` instances in the legend.r cSsg|]}t|t<01>r|<01>qSr/)rhr )r<>r<>r/r/r0r<><00>sz&Legend.get_patches.<locals>.<listcomp>)rrl)r-r/r/r0<00> get_patches<65>szLegend.get_patchescCs td|j<01>S)z7Return a list of `~.text.Text` instances in the legend.ZText)rrk)r-r/r/r0<00> get_texts<74>szLegend.get_textscCs||jj<01>|<01>|r.|jj<01>d<01>|j<00>d<01>n|jj<01>d<02>|j<00>d<02>|dk rrt|t<05>rdtf|<02>}|jj<01>|<02>d|_dS)zk
Set the legend title. Fontproperties can be optionally set
with *prop* parameter.
TFN) rmr<>Zset_textZ set_visiblerhrir
Zset_fontpropertiesr<73>)r-r<>rgr/r/r0r<><00>s 

zLegend.set_titlecCs|jjS)z1Return the `.Text` instance for the legend title.)rmr<>)r-r/r/r0<00> get_title<6C>szLegend.get_titlecCs|dkr|jj}|jj|d<02>S)zReturn extent of the legend.N)r<>)r~Z_cachedRendererr,r<>)r-r<>r/r/r0r<><00>szLegend.get_window_extentcCs |j<00>|<01>S)a<>
Like `.Legend.get_window_extent`, but uses the box for the legend.
Parameters
----------
renderer : `.RendererBase` instance
renderer that will be used to draw the figures (i.e.
``fig.canvas.get_renderer()``)
Returns
-------
`.BboxBase` : containing the bounding box in figure pixel co-ordinates.
)r,r<>)r-r<>r/r/r0<00> get_tightbbox<6F>szLegend.get_tightbboxcCs|jS)z*Get whether the legend box patch is drawn.)r<>)r-r/r/r0<00> get_frame_onszLegend.get_frame_oncCs||_d|_dS)zt
Set whether the legend box patch is drawn.
Parameters
----------
b : bool
TN)r<>r<>)r-r<>r/r/r0r<>szLegend.set_frame_oncCs|jdkr|jjS|jSdS)z4Return the bbox that the legend will be anchored to.N)<03>_bbox_to_anchorr<72>r&)r-r/r/r0r8s
zLegend.get_bbox_to_anchorcCs<>|dkrd|_dSt|t<02>r$||_nZy t|<01>}Wn$tk
rTtdt|<01><00><01>YnX|dkrr|d|dddg}tj|<01>|_|dkr<>t |j
j <0B>}t |j|<02>|_d|_ dS)ab
Set the bbox that the legend will be anchored to.
*bbox* can be
- A `.BboxBase` instance
- A tuple of ``(left, bottom, width, height)`` in the given transform
(normalized axes coordinate if None)
- A tuple of ``(left, bottom)`` where the width and height will be
assumed to be zero.
NzInvalid argument for bbox : %srFrr"T)r<>rhrrxrr*rrrr<>rr<>r&rr<>)r-r&r<>r<>r/r/r0r;s" 
   zLegend.set_bbox_to_anchorcCs<>|tdd<02>kst<01>td<02>\ }}}}} }
} } } }}|d|d|d| d|
d| d| d| d |d
|d i
}||}|<04>|j<03>}|<03>|j |<00>}|j||d <0C>}|j|jfS) a<>
Place the *bbox* inside the *parentbbox* according to a given
location code. Return the (x,y) coordinate of the bbox.
- loc: a location code in range(1, 11).
This corresponds to the possible values for self._loc, excluding
"best".
- bbox: bbox to be placed, display coordinate units.
- parentbbox: a parent box which will contain the bbox. In
display coordinates.
r"<00> ZNEZNWZSWZSE<53>E<>W<>S<>N<>C)<01> container) <09>ranger<65>r<>rjZpaddedr`Zanchoredr<64>r<>)r-r%r&Z
parentbboxr<EFBFBD>ZBESTZURZULZLLZLR<4C>RZCL<43>CRZLCZUCr<43>Z anchor_coefs<66>cr<63>r<>Z anchored_boxr/r/r0r<>9s"  zLegend._get_anchored_bboxcs<00>js
t<01><01><03><02>\}}}}<08>jr8|jddkr8t<05>d<03>t<07>dd||<02><04>|dkrr<72><00><02>fdd<06>t dt
<EFBFBD>j <0B><01>D<00>}g} x<>t |<04>D]x\}
\} } t<07>| | ||<02><04>d} <0A><01> |<05><01><01> |<08><00><01>|<06>t<0F>fdd <09>|D<00><01>} | dkr<>| | fS| <09>| |
| | ff<03>q<>Wt| <09>\}}\} } | | fS)
z<EFBFBD>
Determine the best location to place the legend.
*consider* is a list of ``(x, y)`` pairs to consider as a potential
lower-left corner of the legend. All are display coords.
ri@ zGCreating legend with loc="best" can be slow with large amounts of data.Ncs g|]}<01><02>|<01><00><02><01><00><01><04>qSr/)r<>r8)r<>r<>)r&r<>r-r/r0r<>psz.Legend._find_best_position.<locals>.<listcomp>r"c3s|]}|j<00>dd<01>VqdS)F)ZfilledN)Zintersects_bbox)r<><00>line)<01> legendBoxr/r0<00> <genexpr>sz-Legend._find_best_position.<locals>.<genexpr>)r|r<>r<>r<><00>shaperrtrr<>r<>rxr<><00> enumerateZcount_containsZcount_overlaps<70>sumrvr<>)r-r9r:r<>ZconsiderZvertsr<73>r<>r<><00>
candidates<EFBFBD>idxr<78>r<>Zbadnessrar/)r&r<>r<>r-r0r<>\s(
( zLegend._find_best_positioncCs |j<00>|<01>S)N)r<>r1)r-<00>eventr/r/r0r1<00>szLegend.containsFr%cCs@|r |jdkr:t|||d<02>|_n|jdk r4|j<00><02>d|_|jS)a<>
Enable or disable mouse dragging support of the legend.
Parameters
----------
state : bool
Whether mouse dragging is enabled.
use_blit : bool, optional
Use blitting for faster image composition. For details see
:ref:`func-animation`.
update : {'loc', 'bbox'}, optional
The legend parameter to be changed when dragged:
- 'loc': update the *loc* parameter of the legend
- 'bbox': update the *bbox_to_anchor* parameter of the legend
Returns
-------
If *state* is ``True`` this returns the `~.DraggableLegend` helper
instance. Otherwise this returns ``None``.
N)r.)r<>r$Z
disconnect)r-<00>stater'r.r/r/r0<00> set_draggable<6C>s
 

zLegend.set_draggablecCs
|jdk S)z@Return ``True`` if the legend is draggable, ``False`` otherwise.N)r<>)r-r/r/r0<00> get_draggable<6C>szLegend.get_draggable)NNNTNNNNNNNNNNNr"NNNNNNNNNNNN)N)T)N)N)N)N)Fr%)GrArBrC<00>__doc__r<5F>ZzorderrRrZdedent_interpdr+r<>r<>r<><00>propertyr>r<>rr<>r<>r!r#Z HandlerStemrZHandlerErrorbarr Z HandlerLine2Dr Z HandlerPatchrZHandlerLineCollectionrZHandlerRegularPolyCollectionrZHandlerCircleCollectionr Zupdate_from_first_childr<Z HandlerTuplerZHandlerPathCollectionrZHandlerPolyCollectionr<6E><00> classmethodr<64>r<>r<>r<><00> staticmethodr<64>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r8r;r<>r<>r1r<>rr/r/r/r0rEAs<> V  
 #
     
x4
 

 
##
-
!rEc cs<>g}x^|D]V}||j|j|j|j7}t|d<01>r
x*|jD] }||j|j|j|j7}q<Wq
Wt<06><07>}|dk r<>|<05><08>}|<05> |<01>tj
}x,|D]$}|<07> <0B>}|dkr<>|||<07>r<>|Vq<>WdS)zU
Return a generator of artists that can be used as handles in
a legend.
<20> parasitesNZ
_nolegend_) r<>r<>r<>Z
containers<EFBFBD>hasattrrrEr<>r<>r.r<><00> get_label) <09>axsr<73>Zhandles_originalr<6C>Zaxxr<78>Z has_handlerr<72>r<>r/r/r0<00>_get_legend_handles<65>s"

 "

r cCsNg}g}x<t||<01>D].}|<04><01>}|r|<05>d<01>s|<02>|<04>|<03>|<05>qW||fS)zA
Return handles and labels for legend, internal method.
ra)r rrsrv)rr<>r<>r<>r<>r<>r/r/r0<00>_get_legend_handles_labels<6C>s
r
)r<>r<>cOs<t<00>t<02>}|<04>di<00>pi}d}|dk s.|dk r<|r<t<04>d<04>|rX|rXtt||<02><02>\}}n<>|dk rx|dkrxdd<06>|D<00>}n<>|dk r<>|dkr<>dd<06>tt||<06>|<02>D<00>}n<>t|<03>dkr<>t ||<06>\}}|s<>|<05>
d <09>nbt|<03>d
kr<>|\}d d<06>tt||<06>|<02>D<00>}n4t|<03>d k<05>r(|dd <0C>\}}|d d<03>}nt d <0A><01>||||fS)z<>
Get the handles and labels from the calls to either ``figure.legend``
or ``axes.legend``.
``axs`` is a list of axes (to get legend artists from)
r<>r/NzMYou have mixed positional and keyword arguments, some input may be discarded.cSsg|] }|<01><00><00>qSr/)r)r<>r<>r/r/r0r<><00>sz&_parse_legend_args.<locals>.<listcomp>cSsg|] \}}|<01>qSr/r/)r<>r<>r<>r/r/r0r<><00>srz.No handles with labels found to put in legend.r"cSsg|] \}}|<01>qSr/r/)r<>r<>r<>r/r/r0r<>srFzInvalid arguments to legend.) <0C>logging<6E> getLoggerrA<00>getrrtrqr rxr
<00>warningr)rr<>r<><00>args<67>kwargs<67>log<6F>handlers<72>
extra_argsr/r/r0<00>_parse_legend_args<67>s2

   r)N)N)8rr ZnumpyrzZ
matplotlibrrrZmatplotlib.artistrrZmatplotlib.cbookrrr Zmatplotlib.font_managerr
Zmatplotlib.linesr Zmatplotlib.patchesr r rrZmatplotlib.collectionsrrrrrZmatplotlib.transformsrrrrrZmatplotlib.offsetboxrrrrrZmatplotlib.containerrr r!r<>r#r$rDZinterpdr.rEr r
rr/r/r/r0<00><module>s@      y