
    h                       S r SSKJr  SSKJrJrJr  SSKJrJ	r	  SSK
r
SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr  SSKrSSKrSSKJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'  SSK(J)r)  SS	K*J+r+  SS
K,J-r-  SSK.J/r/  SSK0J1r1  SSK2J3r3  SSK4J5r5  SSK6J7r7J8r8  \Rr                  " \:5      r;SSSSSSSSSSSSSSS.r<SSSSSSSSSSSSSSS.r=SRS  jr>S! r? " S" S#5      r@ " S$ S%5      rA " S& S'5      rB " S( S)5      rC " S* S+\C5      rD " S, S-\C5      rE " S. S/\C5      rF " S0 S1\C5      rG " S2 S3\	5      rH " S4 S5\G5      rI " S6 S7\C5      rJ " S8 S9\G5      rKS: rLS; rMSRS< jrNS= rOS> rP\S? 5       rQ " S@ SA5      rRSSSB jrSSSSC jrT " SD SE\U5      rV " SF SG5      rW\R                  rX " SH SI\Y\5      rZ " SJ SK5      r[ " SL SM5      r\ " SN SO5      r] " SP SQ\]5      r^g)Ta  
Abstract base classes define the primitives that renderers and
graphics contexts must implement to serve as a Matplotlib backend.

`RendererBase`
    An abstract base class to handle drawing/rendering operations.

`FigureCanvasBase`
    The abstraction layer that separates the `.Figure` from the backend
    specific details like a user interface drawing area.

`GraphicsContextBase`
    An abstract base class that provides color, line styles, etc.

`Event`
    The base class for all of the Matplotlib event handling.  Derived classes
    such as `KeyEvent` and `MouseEvent` store the meta data like keys and
    buttons pressed, x and y locations in pixel and `~.axes.Axes` coordinates.

`ShowBase`
    The base class for the ``Show`` class of each interactive backend; the
    'show' callable is then set to ``Show.__call__``.

`ToolContainerBase`
    The base class for the Toolbar class of each interactive backend.
    )
namedtuple)	ExitStackcontextmanagernullcontext)EnumIntEnumN)WeakKeyDictionary)_apibackend_toolscbookcolors
_docstringtext_tight_bbox
transformswidgetsis_interactivercParams)Gcf)ToolManager)_setattr_cm)ConstrainedLayoutEngine)Path)
TexManager)Affine2D)	JoinStyleCapStylezEncapsulated Postscriptz Joint Photographic Experts GroupzPortable Document FormatzPGF code for LaTeXzPortable Network Graphics
PostscriptzRaw RGBA bitmapzScalable Vector GraphicszTagged Image File FormatzWebP Image Format)epsjpgjpegpdfpgfpngpsrawrgbasvgsvgztiftiffwebpzmatplotlib.backends.backend_pszmatplotlib.backends.backend_aggzmatplotlib.backends.backend_pdfzmatplotlib.backends.backend_pgfzmatplotlib.backends.backend_svgc                 2    Uc  SnU[         U '   U[        U '   g)z
Register a backend for saving to a given file format.

Parameters
----------
format : str
    File extension
backend : module string or canvas class
    Backend for handling file output
description : str, default: ""
    Description of the file type.
N )_default_backends_default_filetypes)formatbackenddescriptions      J/var/www/html/env/lib/python3.13/site-packages/matplotlib/backend_bases.pyregister_backendr5   a   s%      'f!,v    c                     U [         ;  a  g[         U    n[        U[        5      (       a)  [        R                  " U5      R
                  nU[         U '   U$ )zj
Return the registered default canvas for given file format.
Handles deferred import of required backend.
N)r/   
isinstancestr	importlibimport_moduleFigureCanvas)r1   backend_classs     r4   get_registered_canvas_classr>   t   sN    
 &&%f-M-%%!//>KK$1&!r6   c                      ^  \ rS rSrSrU 4S jrS#S jrS rS#S jr S#S jr	S	 r
S
 rS rS rS rS rS rS#S jrS rS rSS.S jrS$S jrS rS rS rS rS rS rS rS rS rS rS  r S! r!S"r"U =r#$ )%RendererBase   a  
An abstract base class to handle drawing/rendering operations.

The following methods must be implemented in the backend for full
functionality (though just implementing `draw_path` alone would give a
highly capable backend):

* `draw_path`
* `draw_image`
* `draw_gouraud_triangles`

The following methods *should* be implemented in the backend for
optimization reasons:

* `draw_text`
* `draw_markers`
* `draw_path_collection`
* `draw_quad_mesh`
c                    > [         TU ]  5         S U l        [        R                  " 5       U l        SU l        SU l        g )Nr   F)super__init___texmanagerr   
TextToPath
_text2path_raster_depth_rasterizing)self	__class__s    r4   rD   RendererBase.__init__   s4    //+!r6   Nc                     g)zb
Open a grouping element with label *s* and *gid* (if set) as id.

Only used by the SVG renderer.
N )rJ   sgids      r4   
open_groupRendererBase.open_group       r6   c                     g)zJ
Close a grouping element with label *s*.

Only used by the SVG renderer.
NrN   rJ   rO   s     r4   close_groupRendererBase.close_group   rS   r6   c                     [         e)z?Draw a `~.path.Path` instance using the given affine transform.NotImplementedError)rJ   gcpath	transformrgbFaces        r4   	draw_pathRendererBase.draw_path   s    !!r6   c           
          UR                  USS9 HV  u  px[        U5      (       d  M  USS u  pU R                  XU[        R                  " 5       R                  X5      -   U5        MX     g)a  
Draw a marker at each of *path*'s vertices (excluding control points).

The base (fallback) implementation makes multiple calls to `draw_path`.
Backends may want to override this method in order to draw the marker
only once and reuse it multiple times.

Parameters
----------
gc : `.GraphicsContextBase`
    The graphics context.
marker_path : `~matplotlib.path.Path`
    The path for the marker.
marker_trans : `~matplotlib.transforms.Transform`
    An affine transform applied to the marker.
path : `~matplotlib.path.Path`
    The locations to draw the markers.
trans : `~matplotlib.transforms.Transform`
    An affine transform applied to the path.
rgbFace : :mpltype:`color`, optional
F)simplifyN)iter_segmentslenr_   r   r   	translate)rJ   r[   marker_pathmarker_transr\   transr^   verticescodesxys              r4   draw_markersRendererBase.draw_markers   sh    .  $11%%1HOH8}}}r+)224>>qD E&(  Ir6   c                    U R                  UX45      nU R                  U[        U5      XVXxXXU5       HP  u  nnnnnUu  nnUS:w  d  US:w  a"  UR                  5       nUR	                  UU5        U R                  UUUU5        MR     g)a  
Draw a collection of *paths*.

Each path is first transformed by the corresponding entry
in *all_transforms* (a list of (3, 3) matrices) and then by
*master_transform*.  They are then translated by the corresponding
entry in *offsets*, which has been first transformed by *offset_trans*.

*facecolors*, *edgecolors*, *linewidths*, *linestyles*, and
*antialiased* are lists that set the corresponding properties.

*offset_position* is unused now, but the argument is kept for
backwards compatibility.

The base (fallback) implementation makes multiple calls to `draw_path`.
Backends may want to override this in order to render each set of
path data only once, and then reference that path multiple times with
the different offsets, colors, styles etc.  The generator methods
`_iter_collection_raw_paths` and `_iter_collection` are provided to
help with (and standardize) the implementation across backends.  It
is highly recommended to use those generators, so that changes to the
behavior of `draw_path_collection` can be made globally.
r   N)_iter_collection_raw_paths_iter_collectionlistfrozenrf   r_   )rJ   r[   master_transformpathsall_transformsoffsetsoffset_trans
facecolors
edgecolors
linewidths
linestylesantialiasedsurlsoffset_positionpath_idsxoyopath_idgc0r^   r\   r]   s                         r4   draw_path_collection!RendererBase.draw_path_collection   s    6 223C38J .2-B-BDNG
O.5)BGS' &OD) Qw"' &,,.	##B+NN3i9.5r6   c                     SSK Jn  UR                  U5      nU
c  Un
[        R                  " UR                  5       /[        5      nU R                  XU/ XgUX/ U	/S/S5      $ )z|
Draw a quadmesh.

The base (fallback) implementation converts the quadmesh to paths and
then calls `draw_path_collection`.
r   )QuadMeshNscreen)matplotlib.collectionsr   _convert_mesh_to_pathsnparrayget_linewidthfloatr   )rJ   r[   ru   	meshWidth
meshHeightcoordinatesrx   offsetTransrz   antialiasedr{   r   rv   r|   s                 r4   draw_quad_meshRendererBase.draw_quad_mesh   sm     	4//<#JXXr//12E:
((%W:BvxI 	Ir6   c                     [         e)a  
Draw a series of Gouraud triangles.

Parameters
----------
gc : `.GraphicsContextBase`
    The graphics context.
triangles_array : (N, 3, 2) array-like
    Array of *N* (x, y) points for the triangles.
colors_array : (N, 3, 4) array-like
    Array of *N* RGBA colors for each point of the triangles.
transform : `~matplotlib.transforms.Transform`
    An affine transform to apply to the points.
rY   )rJ   r[   triangles_arraycolors_arrayr]   s        r4   draw_gouraud_triangles#RendererBase.draw_gouraud_triangles  s
      "!r6   c              #      #    [        U5      n[        U5      n[        XE5      nUS:X  a  g[        R                  " 5       n[	        U5       H)  nX(U-     n	U(       a  [        X8U-     5      nXU-   4v   M+     g7f)a  
Helper method (along with `_iter_collection`) to implement
`draw_path_collection` in a memory-efficient manner.

This method yields all of the base path/transform combinations, given a
master transform, a list of paths and list of transforms.

The arguments should be exactly what is passed in to
`draw_path_collection`.

The backend should take each yielded path and transform and create an
object that can be referenced (reused) later.
r   N)re   maxr   IdentityTransformranger   )
rJ   ru   rv   rw   NpathsNtransformsNr]   ir\   s
             r4   rq   'RendererBase._iter_collection_raw_paths"  sy      U.)$Q;002	qAV$D$^O%DE	$4444	 s   A7A9c                     [        U5      nUS:X  d#  [        U5      [        U5      s=:X  a  S:X  a   g  Og[        U[        U5      5      n[        U[        U5      5      nX-   S-
  U-  $ )aH  
Compute how many times each raw path object returned by
`_iter_collection_raw_paths` would be used when calling
`_iter_collection`. This is intended for the backend to decide
on the tradeoff between using the paths in-line and storing
them once and reusing. Rounds up in case the number of uses
is not the same for every path.
r      )re   r   )	rJ   rv   rw   rx   rz   r{   r   	Npath_idsr   s	            r4   _iter_collection_uses_per_path+RendererBase._iter_collection_uses_per_path?  sg     UQ;#j/S_AA BN 34		3w<(!i//r6   c              #     #    [        U5      n[        U5      n[        X5      n[        U5      n[        U5      n[        U5      n[        U5      n[        U
5      nUS:X  a  US:X  d  US:X  a  gU R                  5       nUR                  U5        SS jnU" U5      nU" UR	                  U5      S5      nU" U5      nU" U5      nU" U5      nU" U5      nU" U	5      nU" U
5      n
US:X  a  UR                  S5        [        R                  " [        UUUUUUUU
5      U5       GH  u  nu  nnn n!n"n#n$n%[        R                  " U5      (       a  [        R                  " U5      (       d  MH  U(       ai  U(       a  UR                  U"5        U(       a  UR                  " U#6   [        U!5      S:X  a  U!S   S:X  a  UR                  S5        OUR                  U!5        U b  [        U 5      S:X  a  U S   S:X  a  Sn UR                  U$5        U(       a  UR                  U%5        UUUUU 4v   GM
     UR                  5         g7f)	a?  
Helper method (along with `_iter_collection_raw_paths`) to implement
`draw_path_collection` in a memory-efficient manner.

This method yields all of the path, offset and graphics context
combinations to draw the path collection.  The caller should already
have looped over the results of `_iter_collection_raw_paths` to draw
this collection.

The arguments should be the same as that passed into
`draw_path_collection`, with the exception of *path_ids*, which is a
list of arbitrary objects that the backend will use to reference one of
the paths created in the `_iter_collection_raw_paths` stage.

Each yielded result is of the form::

   xo, yo, path_id, gc, rgbFace

where *xo*, *yo* is an offset; *path_id* is one of the elements of
*path_ids*; *gc* is a graphics context and *rgbFace* is a color to
use for filling the path.
r   Nc                 z    [        U 5      (       a  [        R                  " U 5      $ [        R                  " U5      $ N)re   	itertoolscyclerepeat)seqdefaults     r4   cycle_or_default7RendererBase._iter_collection.<locals>.cycle_or_defaultx  s.    ,/HHIOOC( 4"))'24r6   )r   r                 r   )re   r   new_gccopy_propertiesr]   set_linewidthr   islicezipr   isfinite
set_dashesset_foregroundset_antialiasedset_urlrestore)&rJ   r[   r   rx   ry   rz   r{   r|   r}   r~   r   r   r   Noffsetsr   NfacecolorsNedgecolorsNlinewidthsNlinestylesNurlsr   r   pathidstoffsetsfcsecslwslssaaspathidr   r   fceclwlsaaurls&                                         r4   rr   RendererBase._iter_collectionP  s    2 Xw<!*o*o*o*oD	1!1fkkkmB	4
 #8,#L$:$:7$CVLz*z*z*z*|,%!c"9B9I9IGXsCc3Eq:J5FHRb"b"b#KKOOB%%b)NNB'r7a<BqESL%%a(&&r*~#b'Q,2a5A:#C b&#r))%:J& 	s   H=H?c                     g)z
Get the factor by which to magnify images passed to `draw_image`.
Allows a backend to have images at a different resolution to other
artists.
      ?rN   rJ   s    r4   get_image_magnification$RendererBase.get_image_magnification  s     r6   c                     [         e)a  
Draw an RGBA image.

Parameters
----------
gc : `.GraphicsContextBase`
    A graphics context with clipping information.

x : float
    The distance in physical units (i.e., dots or pixels) from the left
    hand side of the canvas.

y : float
    The distance in physical units (i.e., dots or pixels) from the
    bottom side of the canvas.

im : (N, M, 4) array of `numpy.uint8`
    An array of RGBA pixels.

transform : `~matplotlib.transforms.Affine2DBase`
    If and only if the concrete backend is written such that
    `option_scale_image` returns ``True``, an affine transformation
    (i.e., an `.Affine2DBase`) *may* be passed to `draw_image`.  The
    translation vector of the transformation is given in physical units
    (i.e., dots or pixels). Note that the transformation does not
    override *x* and *y*, and has to be applied *before* translating
    the result by *x* and *y* (this can be accomplished by adding *x*
    and *y* to the translation vector defined by *transform*).
rY   )rJ   r[   rl   rm   imr]   s         r4   
draw_imageRendererBase.draw_image  s
    < "!r6   c                     g)a  
Return whether image composition by Matplotlib should be skipped.

Raster backends should usually return False (letting the C-level
rasterizer take care of image composition); vector backends should
usually return ``not rcParams["image.composite_image"]``.
FrN   r   s    r4   option_image_nocomposite%RendererBase.option_image_nocomposite  s     r6   c                     g)zp
Return whether arbitrary affine transformations in `draw_image` are
supported (True for most vector backends).
FrN   r   s    r4   option_scale_imageRendererBase.option_scale_image  s    
 r6   )mtextc          
      (    U R                  XX4XVSS9  g)a  
Draw a TeX instance.

Parameters
----------
gc : `.GraphicsContextBase`
    The graphics context.
x : float
    The x location of the text in display coords.
y : float
    The y location of the text baseline in display coords.
s : str
    The TeX text string.
prop : `~matplotlib.font_manager.FontProperties`
    The font properties.
angle : float
    The rotation angle in degrees anti-clockwise.
mtext : `~matplotlib.text.Text`
    The original text object to be rendered.
TeXismathN_draw_text_as_path)rJ   r[   rl   rm   rO   propangler   s           r4   draw_texRendererBase.draw_tex  s    * 	qTGr6   c	           	      ,    U R                  XX4XVU5        g)aY  
Draw a text instance.

Parameters
----------
gc : `.GraphicsContextBase`
    The graphics context.
x : float
    The x location of the text in display coords.
y : float
    The y location of the text baseline in display coords.
s : str
    The text string.
prop : `~matplotlib.font_manager.FontProperties`
    The font properties.
angle : float
    The rotation angle in degrees anti-clockwise.
ismath : bool or "TeX"
    If True, use mathtext parser.
mtext : `~matplotlib.text.Text`
    The original text object to be rendered.

Notes
-----
**Notes for backend implementers:**

`.RendererBase.draw_text` also supports passing "TeX" to the *ismath*
parameter to use TeX rendering, but this is not required for actual
rendering backends, and indeed many builtin backends do not support
this.  Rather, TeX rendering is provided by `~.RendererBase.draw_tex`.
Nr   )	rJ   r[   rl   rm   rO   r   r   r   r   s	            r4   	draw_textRendererBase.draw_text  s    @ 	qT&Ar6   c                 Z   U R                   nU R                  UR                  5       5      n	UR                  XTUS9u  p[	        X5      nU R                  5       (       aY  U R                  5       u  p[        5       R                  XR                  -  5      R                  U5      R                  X.U-
  5      nOC[        5       R                  XR                  -  5      R                  U5      R                  X#5      nUR                  5       nUR                  S5        U R                  XUUS9  g)z
Draw the text by converting them to paths using `.TextToPath`.

This private helper supports the same parameters as
`~.RendererBase.draw_text`; setting *ismath* to "TeX" triggers TeX
rendering.
r   r   )r^   N)rG   points_to_pixelsget_size_in_pointsget_text_pathr   flipyget_canvas_width_heightr   scale
FONT_SCALE
rotate_degrf   get_rgbr   r_   )rJ   r[   rl   rm   rO   r   r   r   	text2pathfontsizevertsrk   r\   widthheightr]   colors                    r4   r   RendererBase._draw_text_as_path  s     OO	(()@)@)BC ..tv.FE!::<< 88:ME!%+?+? ?@$*U+#)Az2 
 "%+?+? ?@$*U+#)A/  


rE:r6   c                    UR                  5       nUS:X  a  U R                  5       R                  XU S9$ U R                  S5      nU(       a+  U R                  R
                  R                  XU5      nUSS $ U R                  R                  5       nU R                  R                  U5      nUR                  XE5        UR                  USUS9  UR                  5       u  pUR                  5       nU	S-  n	U
S-  n
US-  nXU4$ )	z
Get the width, height, and descent (offset from the bottom to the baseline), in
display coords, of the string *s* with `.FontProperties` *prop*.

Whitespace at the start and the end of *s* is included in the reported width.
r   rendererH   r   r   r   )flagsg      P@)r   get_texmanagerget_text_width_height_descentr   rG   mathtext_parserparse_get_hinting_flag	_get_fontset_sizeset_textget_width_heightget_descent)rJ   rO   r   r   r   dpidimsr
  fontwhds               r4   r  *RendererBase.get_text_width_height_descent+  s    **,U?&&(FFd G , , ##B'??2288FD!9113((.h$aE*$$&	T		T		T	Qwr6   c                     g)ze
Return whether y values increase from top to bottom.

Note that this only affects drawing of texts.
TrN   r   s    r4   r   RendererBase.flipyJ  s     r6   c                     g)z5Return the canvas width and height in display coords.)r   r   rN   r   s    r4   r   $RendererBase.get_canvas_width_heightR  s    r6   c                 R    U R                   c  [        5       U l         U R                   $ )z"Return the `.TexManager` instance.)rE   r   r   s    r4   r  RendererBase.get_texmanagerV  s$    #)|Dr6   c                     [        5       $ )z/Return an instance of a `.GraphicsContextBase`.)GraphicsContextBaser   s    r4   r   RendererBase.new_gc\  s    "$$r6   c                     U$ )ad  
Convert points to display units.

You need to override this function (unless your backend
doesn't have a dpi, e.g., postscript or svg).  Some imaging
systems assume some value for pixels per inch::

    points to pixels = points * pixels_per_inch/72 * dpi/72

Parameters
----------
points : float or array-like

Returns
-------
Points converted to pixels
rN   )rJ   pointss     r4   r   RendererBase.points_to_pixels`  s	    $ r6   c                     g)z?
Switch to the raster renderer.

Used by `.MixedModeRenderer`.
NrN   r   s    r4   start_rasterizingRendererBase.start_rasterizingt  rS   r6   c                     g)z
Switch back to the vector renderer and draw the contents of the raster
renderer as an image on the vector renderer.

Used by `.MixedModeRenderer`.
NrN   r   s    r4   stop_rasterizingRendererBase.stop_rasterizing{  rS   r6   c                     g)zl
Switch to a temporary renderer for image filtering effects.

Currently only supported by the agg renderer.
NrN   r   s    r4   start_filterRendererBase.start_filter  rS   r6   c                     g)z
Switch back to the original renderer.  The contents of the temporary
renderer is processed with the *filter_func* and is drawn on the
original renderer as an image.

Currently only supported by the agg renderer.
NrN   )rJ   filter_funcs     r4   stop_filterRendererBase.stop_filter  rS   r6   c                     [        [        5       Vs0 s H%  nUR                  S5      (       d  US;   d  M!  US _M'     nn[        U 40 UD6$ s  snf )z
Context manager to temporary disable drawing.

This is used for getting the drawn size of Artists.  This lets us
run the draw process to update any Python state but does not pay the
cost of the draw_XYZ calls on the canvas.
draw_)rQ   rV   c                      g r   rN   )argskwargss     r4   <lambda>-RendererBase._draw_disabled.<locals>.<lambda>  s    tr6   )dirr@   
startswithr   )rJ   	meth_nameno_opss      r4   _draw_disabledRendererBase._draw_disabled  sb     !.
.	$$W-- == 4I33. 	 
 4*6**
s
    AA)rH   rI   rE   rG   r   )FN)$__name__
__module____qualname____firstlineno____doc__rD   rQ   rV   r_   rn   r   r   r   rq   r   rr   r   r   r   r   r   r   r   r  r   r   r  r   r   r)  r,  r/  r3  r@  __static_attributes____classcell__rK   s   @r4   r@   r@      s    &""
 %)(>+:ZI*"$5:0"L\"@ ;? H. BD;6> %(+ +r6   r@   c                   >   \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS r\R0                  S 5       rS rS rS rS*S jr\R0                  S 5       rS rS r S r!S r"S r#S  r$S+S! jr%S" r&S# r'S$ r(S% r)S& r*S,S( jr+S)r,g')-r#  i  z=An abstract base class that provides color, line styles, etc.c                 h   SU l         SU l        SU l        [        S5      U l        S U l        S U l        SU l        [        S5      U l	        SU l
        SU l        SU l        S U l        [        R                  " [         S	   5      U l        [         S
   U l        S U l        S U l        S U l        S U l        g )Nr   Fr   butt)r   Nroundsolid)r   r   r   r   zhatch.colorzhatch.linewidth)_alpha_forced_alpha_antialiasedr   	_capstyle	_cliprect	_clippath_dashesr   
_joinstyle
_linestyle
_linewidth_rgb_hatchr   to_rgbar   _hatch_color_hatch_linewidth_url_gid_snap_sketchr   s    r4   rD   GraphicsContextBase.__init__  s    "!&)#G,!(	"NN8M+BC (): ;		
r6   c                 h   UR                   U l         UR                  U l        UR                  U l        UR                  U l        UR                  U l        UR
                  U l        UR                  U l        UR                  U l        UR                  U l        UR                  U l	        UR                  U l
        UR                  U l        UR                  U l        UR                  U l        UR                  U l        UR                  U l        UR                   U l        UR"                  U l        g)z"Copy properties from *gc* to self.N)rO  rP  rQ  rR  rS  rT  rU  rV  rW  rX  rY  rZ  r\  r]  r^  r_  r`  ra  )rJ   r[   s     r4   r   #GraphicsContextBase.copy_properties  s    ii--OOzz------GG	iiOO " 3 3GG	GG	XX
zzr6   c                     g)zp
Restore the graphics context from the stack - needed only
for backends that save graphics contexts on a stack.
NrN   r   s    r4   r   GraphicsContextBase.restore  rS   r6   c                     U R                   $ )zK
Return the alpha value used for blending - not supported on all
backends.
)rO  r   s    r4   	get_alphaGraphicsContextBase.get_alpha  s    
 {{r6   c                     U R                   $ )zAReturn whether the object should try to do antialiased rendering.)rQ  r   s    r4   get_antialiased#GraphicsContextBase.get_antialiased         r6   c                 .    U R                   R                  $ )zReturn the `.CapStyle`.)rR  namer   s    r4   get_capstyle GraphicsContextBase.get_capstyle  s    ~~"""r6   c                     U R                   $ )zH
Return the clip rectangle as a `~matplotlib.transforms.Bbox` instance.
rS  r   s    r4   get_clip_rectangle&GraphicsContextBase.get_clip_rectangle  s     ~~r6   c                     U R                   bn  U R                   R                  5       u  p[        R                  " [        R                  " UR
                  5      5      (       a  X4$ [        R                  S5        gg)z
Return the clip path in the form (path, transform), where path
is a `~.path.Path` instance, and transform is
an affine transform to apply to the path before clipping.
z/Ill-defined clip_path detected. Returning None.NN)rT  get_transformed_path_and_affiner   allr   rj   _logwarning)rJ   tpathtrs      r4   get_clip_path!GraphicsContextBase.get_clip_path  sY     >>%FFHIEvvbkk%..122y NO!r6   c                     U R                   $ )zw
Return the dash style as an (offset, dash-list) pair.

See `.set_dashes` for details.

Default value is (None, None).
)rU  r   s    r4   
get_dashesGraphicsContextBase.get_dashes  s     ||r6   c                     U R                   $ )zj
Return whether the value given by get_alpha() should be used to
override any other alpha-channel values.
)rP  r   s    r4   get_forced_alpha$GraphicsContextBase.get_forced_alpha  s    
 !!!r6   c                 .    U R                   R                  $ )zReturn the `.JoinStyle`.)rV  ro  r   s    r4   get_joinstyle!GraphicsContextBase.get_joinstyle  s    ###r6   c                     U R                   $ )z Return the line width in points.)rX  r   s    r4   r   !GraphicsContextBase.get_linewidth  s    r6   c                     U R                   $ )z0Return a tuple of three or four floats from 0-1.)rY  r   s    r4   r   GraphicsContextBase.get_rgb      yyr6   c                     U R                   $ )z+Return a url if one is set, None otherwise.r^  r   s    r4   get_urlGraphicsContextBase.get_url  r  r6   c                     U R                   $ )z;Return the object identifier if one is set, None otherwise.r_  r   s    r4   get_gidGraphicsContextBase.get_gid  r  r6   c                     U R                   $ )z
Return the snap setting, which can be:

* True: snap vertices to the nearest pixel center
* False: leave vertices as-is
* None: (auto) If the path contains only rectilinear line segments,
  round to the nearest pixel center
r`  r   s    r4   get_snapGraphicsContextBase.get_snap   s     zzr6   c                 v    Ub  Xl         SU l        OSU l         SU l        U R                  U R                  SS9  g)a  
Set the alpha value used for blending - not supported on all backends.

If ``alpha=None`` (the default), the alpha components of the
foreground and fill colors will be used to set their respective
transparencies (where applicable); otherwise, ``alpha`` will override
them.
NTr   F)isRGBA)rO  rP  r   rY  )rJ   alphas     r4   	set_alphaGraphicsContextBase.set_alpha+  s=     K!%DDK!&DDIId3r6   c                 6    [        [        U5      5      U l        g)z>Set whether object should be drawn with antialiased rendering.N)intboolrQ  )rJ   bs     r4   r   #GraphicsContextBase.set_antialiased<  s      QLr6   c                 $    [        U5      U l        g)z]
Set how to draw endpoints of lines.

Parameters
----------
cs : `.CapStyle` or %(CapStyle)s
N)r   rR  )rJ   css     r4   set_capstyle GraphicsContextBase.set_capstyleA  s     ""r6   c                     Xl         g)z,Set the clip rectangle to a `.Bbox` or None.Nrs  )rJ   	rectangles     r4   set_clip_rectangle&GraphicsContextBase.set_clip_rectangleL  s    "r6   c                 Z    [         R                  " [        R                  S4US9  Xl        g)z2Set the clip path to a `.TransformedPath` or None.N)r\   )r
   check_isinstancer   TransformedPathrT  )rJ   r\   s     r4   set_clip_path!GraphicsContextBase.set_clip_pathP  s"    z994@tLr6   c                    Uby  [         R                  " U5      n[         R                  " US:  5      (       a  [        S5      eUR                  (       a)  [         R                  " US:  5      (       d  [        S5      eX4U l        g)a  
Set the dash style for the gc.

Parameters
----------
dash_offset : float
    Distance, in points, into the dash pattern at which to
    start the pattern. It is usually set to 0.
dash_list : array-like or None
    The on-off sequence as points.  None specifies a solid line. All
    values must otherwise be non-negative (:math:`\ge 0`).

Notes
-----
See p. 666 of the PostScript
`Language Reference
<https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf>`_
for more info.
Nr   z0All values in the dash list must be non-negativez4At least one value in the dash list must be positive)r   asarrayany
ValueErrorsizerU  )rJ   dash_offset	dash_listdls       r4   r   GraphicsContextBase.set_dashesU  sr    (  I&Bvvb3h FH Hwwrvvb3h// JL L"-r6   c                 &   U R                   (       a   U(       a  USS U R                  4-   U l        gU R                   (       a&  [        R                  " XR                  5      U l        gU(       a  Xl        g[        R                  " U5      U l        g)z
Set the foreground color.

Parameters
----------
fg : :mpltype:`color`
isRGBA : bool
    If *fg* is known to be an ``(r, g, b, a)`` tuple, *isRGBA* can be
    set to True to improve performance.
Nr   )rP  rO  rY  r   r[  )rJ   fgr  s      r4   r   "GraphicsContextBase.set_foregrounds  s\     &2A$++/DIr;;7DIIr*DIr6   c                 $    [        U5      U l        g)zn
Set how to draw connections between line segments.

Parameters
----------
js : `.JoinStyle` or %(JoinStyle)s
N)r   rV  )rJ   jss     r4   set_joinstyle!GraphicsContextBase.set_joinstyle  s     $B-r6   c                 $    [        U5      U l        g)zSet the linewidth in points.N)r   rX  )rJ   r  s     r4   r   !GraphicsContextBase.set_linewidth  s    (r6   c                     Xl         g)z-Set the url for links in compatible backends.Nr  )rJ   r   s     r4   r   GraphicsContextBase.set_url  s    	r6   c                     Xl         g)zSet the id.Nr  )rJ   ids     r4   set_gidGraphicsContextBase.set_gid  s    	r6   c                     Xl         g)z
Set the snap setting which may be:

* True: snap vertices to the nearest pixel center
* False: leave vertices as-is
* None: (auto) If the path contains only rectilinear line segments,
  round to the nearest pixel center
Nr  )rJ   snaps     r4   set_snapGraphicsContextBase.set_snap  s	     
r6   c                     Xl         g)z Set the hatch style (for fills).NrZ  )rJ   hatchs     r4   	set_hatchGraphicsContextBase.set_hatch  s    r6   c                     U R                   $ )zGet the current hatch style.r  r   s    r4   	get_hatchGraphicsContextBase.get_hatch  s    {{r6   c                 V    U R                  5       nUc  g[        R                  " X!5      $ )z'Return a `.Path` for the current hatch.N)r  r   r  )rJ   densityr  s      r4   get_hatch_path"GraphicsContextBase.get_hatch_path  s%     =zz%))r6   c                     U R                   $ )zGet the hatch color.r\  r   s    r4   get_hatch_color#GraphicsContextBase.get_hatch_color  rm  r6   c                     Xl         g)zSet the hatch color.Nr  )rJ   hatch_colors     r4   set_hatch_color#GraphicsContextBase.set_hatch_color  s    'r6   c                     U R                   $ )zGet the hatch linewidth.r]  r   s    r4   get_hatch_linewidth'GraphicsContextBase.get_hatch_linewidth  s    $$$r6   c                     Xl         g)zSet the hatch linewidth.Nr  )rJ   hatch_linewidths     r4   set_hatch_linewidth'GraphicsContextBase.set_hatch_linewidth  s     /r6   c                     U R                   $ )a  
Return the sketch parameters for the artist.

Returns
-------
tuple or `None`

    A 3-tuple with the following elements:

    * ``scale``: The amplitude of the wiggle perpendicular to the
      source line.
    * ``length``: The length of the wiggle along the line.
    * ``randomness``: The scale factor by which the length is
      shrunken or expanded.

    May return `None` if no sketch parameters were set.
ra  r   s    r4   get_sketch_params%GraphicsContextBase.get_sketch_params  s    $ ||r6   Nc                 P    Uc  SU l         gX=(       d    SU=(       d    S4U l         g)a  
Set the sketch parameters.

Parameters
----------
scale : float, optional
    The amplitude of the wiggle perpendicular to the source line, in
    pixels.  If scale is `None`, or not provided, no sketch filter will
    be provided.
length : float, default: 128
    The length of the wiggle along the line, in pixels.
randomness : float, default: 16
    The scale factor by which the length is shrunken or expanded.
Ng      `@g      0@r  )rJ   r   length
randomnesss       r4   set_sketch_params%GraphicsContextBase.set_sketch_params  s*      MD 	4):s; 	r6   )rO  rQ  rR  rT  rS  rU  rP  r_  rZ  r\  r]  rV  rW  rX  rY  ra  r`  r^  )F)g      @)NNN)-rB  rC  rD  rE  rF  rD   r   r   rh  rk  rp  rt  r~  r  r  r  r   r   r  r  r  r  r   r   interpdr  r  r  r   r   r  r   r   r  r  r  r  r  r  r  r  r  r  r  rG  rN   r6   r4   r#  r#    s    G("*!#"$	4")
 & &#
.<+( ( (#	*!(%0(=r6   r#  c                       \ rS rSrSrSS jrS r\R                  " SSSS	9SS
 j5       r	S r
S rS r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       rS rS rS rS rS rSrg)	TimerBasei  a  
A base class for providing timer events, useful for things animations.
Backends need to implement a few specific methods in order to use their
own timing mechanisms so that the timer events are integrated into their
event loops.

Subclasses must override the following methods:

- ``_timer_start``: Backend-specific code for starting the timer.
- ``_timer_stop``: Backend-specific code for stopping the timer.

Subclasses may additionally override the following methods:

- ``_timer_set_single_shot``: Code for setting the timer to single shot
  operating mode, if supported by the timer object.  If not, the `Timer`
  class itself will store the flag and the ``_on_timer`` method should be
  overridden to support such behavior.

- ``_timer_set_interval``: Code for setting the interval on the timer, if
  there is a method for doing so on the timer object.

- ``_on_timer``: The internal function that any timer object should call,
  which will handle the task of running all callbacks that have been set.
Nc                 ^    Uc  / OUR                  5       U l        Uc  SOUU l        SU l        g)a  
Parameters
----------
interval : int, default: 1000ms
    The time between timer events in milliseconds.  Will be stored as
    ``timer.interval``.
callbacks : list[tuple[callable, tuple, dict]]
    List of (func, args, kwargs) tuples that will be called upon timer
    events.  This list is accessible as ``timer.callbacks`` and can be
    manipulated directly, or the functions `~.TimerBase.add_callback`
    and `~.TimerBase.remove_callback` can be used.
Ni  F)copy	callbacksintervalsingle_shotrJ   r  r  s      r4   rD   TimerBase.__init__
  s/      )0inn6F ( 0h r6   c                 $    U R                  5         g)z1Need to stop timer and possibly disconnect timer.N_timer_stopr   s    r4   __del__TimerBase.__del__      r6   3.9r  ztimer.interval)alternativec                 6    Ub  Xl         U R                  5         g)z
Start the timer object.

Parameters
----------
interval : int, optional
    Timer interval in milliseconds; overrides a previously set interval
    if provided.
N)r  _timer_startrJ   r  s     r4   startTimerBase.start   s     $Mr6   c                 $    U R                  5         g)zStop the timer.Nr  r   s    r4   stopTimerBase.stop/  r  r6   c                     g r   rN   r   s    r4   r  TimerBase._timer_start3      r6   c                     g r   rN   r   s    r4   r  TimerBase._timer_stop6  r  r6   c                     U R                   $ )z/The time between timer events, in milliseconds.)	_intervalr   s    r4   r  TimerBase.interval9  s     ~~r6   c                 Z    [        [        U5      S5      nXl        U R                  5         g )Nr   )r   r  r  _timer_set_intervalr  s     r4   r  r  >  s%    
 s8}a(!  "r6   c                     U R                   $ )z2Whether this timer should stop after a single run.)_singler   s    r4   r  TimerBase.single_shotG  s     ||r6   c                 0    Xl         U R                  5         g r   )r  _timer_set_single_shot)rJ   sss     r4   r  r  L  s    ##%r6   c                 @    U R                   R                  XU45        U$ )z
Register *func* to be called by timer when the event fires. Any
additional arguments provided will be passed to *func*.

This function returns *func*, which makes it possible to use it as a
decorator.
)r  append)rJ   funcr8  r9  s       r4   add_callbackTimerBase.add_callbackQ  s      	t623r6   c                 ,   U(       d  U(       a3  [         R                  " SSS9  U R                  R                  XU45        gU R                   Vs/ s H  oDS   PM	     nnX;   a+  U R                  R	                  UR                  U5      5        ggs  snf )a  
Remove *func* from list of callbacks.

*args* and *kwargs* are optional and used to distinguish between copies
of the same function registered to be called with different arguments.
This behavior is deprecated.  In the future, ``*args, **kwargs`` won't
be considered anymore; to keep a specific callback removable by itself,
pass it to `add_callback` as a `functools.partial` object.
z3.1zIn a future version, Timer.remove_callback will not take *args, **kwargs anymore, but remove all callbacks where the callable matches; to keep a specific callback removable by itself, pass it to add_callback as a functools.partial object.messager   N)r
   warn_deprecatedr  removepopindex)rJ   r  r8  r9  cfuncss         r4   remove_callbackTimerBase.remove_callback\  s|     6    ,- NN!!4v"67#'>>2>aqT>E2}""5;;t#45  3s   Bc                     g)z0Used to set interval on underlying timer object.NrN   r   s    r4   r  TimerBase._timer_set_intervals  rS   r6   c                     g)z3Used to set single shot on underlying timer object.NrN   r   s    r4   r   TimerBase._timer_set_single_shotv  rS   r6   c                     U R                    H3  u  pnU" U0 UD6nUS:X  d  M  U R                   R                  XU45        M5     [        U R                   5      S:X  a  U R                  5         gg)z
Runs all function that have been registered as callbacks. Functions
can return False (or 0) if they should not be called any more. If there
are no callbacks, the timer is automatically stopped.
r   N)r  r%  re   r
  )rJ   r  r8  r9  rets        r4   	_on_timerTimerBase._on_timery  sg     #'..D''C ax%%t6&:; #1 t~~!#IIK $r6   )r  r  r  r  r  rw  r   )rB  rC  rD  rE  rF  rD   r  r
   delete_parameterr  r
  r  r  propertyr  setterr  r  r*  r  r  r2  rG  rN   r6   r4   r  r    s    2!$ 
5*:JK L   __# #   & &	6.?Br6   r  c                   (    \ rS rSrSrSS jrS rSrg)Eventi  a^  
A Matplotlib event.

The following attributes are defined and shown with their default values.
Subclasses may define additional attributes.

Attributes
----------
name : str
    The event name.
canvas : `FigureCanvasBase`
    The backend-specific canvas instance generating the event.
guiEvent
    The GUI event that triggered the Matplotlib event.
Nc                 (    Xl         X l        X0l        g r   )ro  canvasguiEvent)rJ   ro  r:  r;  s       r4   rD   Event.__init__  s    	 r6   c                 r    U R                   R                  R                  U R                  U 5        SU l        g)z?Process this event on ``self.canvas``, then unset ``guiEvent``.N)r:  r  processro  r;  r   s    r4   _processEvent._process  s'    %%dii6r6   )r:  r;  ro  r   )rB  rC  rD  rE  rF  rD   r?  rG  rN   r6   r4   r8  r8    s     !
r6   r8  c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )	DrawEventi  a~  
An event triggered by a draw operation on the canvas.

In most backends, callbacks subscribed to this event will be fired after
the rendering is complete but before the screen is updated. Any extra
artists drawn to the canvas's renderer will be reflected without an
explicit call to ``blit``.

.. warning::

   Calling ``canvas.draw`` and ``canvas.blit`` in these callbacks may
   not be safe with all backends and may cause infinite recursion.

A DrawEvent has a number of special attributes in addition to those defined
by the parent `Event` class.

Attributes
----------
renderer : `RendererBase`
    The renderer for the draw event.
c                 0   > [         TU ]  X5        X0l        g r   )rC   rD   r  )rJ   ro  r:  r  rK   s       r4   rD   DrawEvent.__init__  s    & r6   r  rB  rC  rD  rE  rF  rD   rG  rH  rI  s   @r4   rB  rB    s    *! !r6   rB  c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ResizeEventi  a  
An event triggered by a canvas resize.

A ResizeEvent has a number of special attributes in addition to those
defined by the parent `Event` class.

Attributes
----------
width : int
    Width of the canvas in pixels.
height : int
    Height of the canvas in pixels.
c                 ^   > [         TU ]  X5        UR                  5       u  U l        U l        g r   )rC   rD   r  r  r  )rJ   ro  r:  rK   s      r4   rD   ResizeEvent.__init__  s'    &"("9"9";
DKr6   )r  r  rE  rI  s   @r4   rG  rG    s    < <r6   rG  c                       \ rS rSrSrSrg)
CloseEventi  z,An event triggered by a figure being closed.rN   NrB  rC  rD  rE  rF  rG  rN   r6   r4   rK  rK    s    6r6   rK  c                   F   ^  \ rS rSrSrSrSSS.U 4S jjjrSS jrSrU =r	$ )	LocationEventi  a@  
An event that has a screen location.

A LocationEvent has a number of special attributes in addition to those
defined by the parent `Event` class.

Attributes
----------
x, y : int or None
    Event location in pixels from bottom left of canvas.
inaxes : `~matplotlib.axes.Axes` or None
    The `~.axes.Axes` instance over which the mouse is, if any.
xdata, ydata : float or None
    Data coordinates of the mouse within *inaxes*, or *None* if the mouse
    is not over an Axes.
modifiers : frozenset
    The keyboard modifiers currently being pressed (except for KeyEvent).
N	modifiersc                  > [         TU ]  XUS9  Ub  [        U5      OUU l        Ub  [        U5      OUU l        S U l        S U l        S U l        [        Ub  UO/ 5      U l	        Ub  Uc  g U R                  U R                  R                  c  U R                  R                  X445      OU R                  R                  X445        g N)r;  )rC   rD   r  rl   rm   inaxesxdataydata	frozensetrP  _set_inaxesr:  mouse_grabber)rJ   ro  r:  rl   rm   r;  rP  rK   s          r4   rD   LocationEvent.__init__  s    9=Qa=Qa

"	0E92N9	 KK55= ++QF322	!r6   c                     Xl         UbS   UR                  R                  5       R                  Ub  UOU R                  U R
                  45      u  U l        U l        g g ! [         a     g f = fr   )	rS  	transDatainvertedr]   rl   rm   rT  rU  r  )rJ   rS  xys      r4   rW  LocationEvent._set_inaxes  sj    )/)9)9)B)B)D)N)N.Btvvtvv.>*@&
DJ   s   AA 
A+*A+)rS  rP  rl   rT  rm   rU  r   )
rB  rC  rD  rE  rF  _last_axes_refrD   rW  rG  rH  rI  s   @r4   rN  rN    s*    & N!t ! !4 r6   rN  c                   (    \ rS rSrSrSrSrSrSrSr	g)	MouseButtoni  r      r      	   rN   N)
rB  rC  rD  rE  LEFTMIDDLERIGHTBACKFORWARDrG  rN   r6   r4   ra  ra    s    DFEDGr6   ra  c                   D   ^  \ rS rSrSr  SSSS.U 4S jjjrS rSrU =r$ )	
MouseEventi  a
  
A mouse event ('button_press_event', 'button_release_event', 'scroll_event', 'motion_notify_event').

A MouseEvent has a number of special attributes in addition to those
defined by the parent `Event` and `LocationEvent` classes.

Attributes
----------
button : None or `MouseButton` or {'up', 'down'}
    The button pressed. 'up' and 'down' are used for scroll events.

    Note that LEFT and RIGHT actually refer to the "primary" and
    "secondary" buttons, i.e. if the user inverts their left and right
    buttons ("left-handed setting") then the LEFT button will be the one
    physically on the right.

    If this is unset, *name* is "scroll_event", and *step* is nonzero, then
    this will be set to "up" or "down" depending on the sign of *step*.

buttons : None or frozenset
    For 'motion_notify_event', the mouse buttons currently being pressed
    (a set of zero or more MouseButtons);
    for other events, None.

    .. note::
       For 'motion_notify_event', this attribute is more accurate than
       the ``button`` (singular) attribute, which is obtained from the last
       'button_press_event' or 'button_release_event' that occurred within
       the canvas (and thus 1. be wrong if the last change in mouse state
       occurred when the canvas did not have focus, and 2. cannot report
       when multiple buttons are pressed).

       This attribute is not set for 'button_press_event' and
       'button_release_event' because GUI toolkits are inconsistent as to
       whether they report the button state *before* or *after* the
       press/release occurred.

    .. warning::
       On macOS, the Tk backends only report a single button even if
       multiple buttons are pressed.

key : None or str
    The key pressed when the mouse event triggered, e.g. 'shift'.
    See `KeyEvent`.

    .. warning::
       This key is currently obtained from the last 'key_press_event' or
       'key_release_event' that occurred within the canvas.  Thus, if the
       last change of keyboard state occurred while the canvas did not have
       focus, this attribute will be wrong.  On the other hand, the
       ``modifiers`` attribute should always be correct, but it can only
       report on modifier keys.

step : float
    The number of scroll steps (positive for 'up', negative for 'down').
    This applies only to 'scroll_event' and defaults to 0 otherwise.

dblclick : bool
    Whether the event is a double-click. This applies only to
    'button_press_event' and is False otherwise. In particular, it's
    not used in 'button_release_event'.

Examples
--------
::

    def on_press(event):
        print('you pressed', event.button, event.xdata, event.ydata)

    cid = fig.canvas.mpl_connect('button_press_event', on_press)
N)buttonsrP  c
          	      L  > [         TU ]  XX4XS9  U[        R                  R	                  5       ;   a  [        U5      nUS:X  a  Uc  US:  a  SnOUS:  a  SnXPl        US:X  a  [        U
b  U
O/ 5      U l        OU
(       a  [        S5      eS U l        X`l	        Xpl
        Xl        g )N)r;  rP  scroll_eventr   updownmotion_notify_eventz5'buttons' is only supported for 'motion_notify_event')rC   rD   ra  __members__valuesbuttonrV  rl  r  keystepdblclick)rJ   ro  r:  rl   rm   rt  ru  rv  rw  r;  rl  rP  rK   s               r4   rD   MouseEvent.__init__h  s     	! 	 	H[,,3355 (F>!fnax(($0CWLDL
  KM MDL	 r6   c                     U R                    SU R                   SU R                   SU R                   SU R                   SU R
                   SU R                   SU R                   3$ )Nz: xy=(, z
) xydata=(z	) button=z
 dblclick=z inaxes=)ro  rl   rm   rT  rU  rt  rw  rS  r   s    r4   __str__MouseEvent.__str__  si    99+ vvhb
4::,b M++j @++( 	)r6   )rt  rl  rw  ru  rv  )NNr   FN)	rB  rC  rD  rE  rF  rD   r{  rG  rH  rI  s   @r4   rk  rk    s1    GR =A26!! !6) )r6   rk  c                   2   ^  \ rS rSrSr SU 4S jjrSrU =r$ )	PickEventi  ac  
A pick event.

This event is fired when the user picks a location on the canvas
sufficiently close to an artist that has been made pickable with
`.Artist.set_picker`.

A PickEvent has a number of special attributes in addition to those defined
by the parent `Event` class.

Attributes
----------
mouseevent : `MouseEvent`
    The mouse event that generated the pick.
artist : `~matplotlib.artist.Artist`
    The picked artist.  Note that artists are not pickable by default
    (see `.Artist.set_picker`).
other
    Additional attributes may be present depending on the type of the
    picked object; e.g., a `.Line2D` pick may define different extra
    attributes than a `.PatchCollection` pick.

Examples
--------
Bind a function ``on_pick()`` to pick events, that prints the coordinates
of the picked data point::

    ax.plot(np.rand(100), 'o', picker=5)  # 5 points tolerance

    def on_pick(event):
        line = event.artist
        xdata, ydata = line.get_data()
        ind = event.ind
        print(f'on pick line: {xdata[ind]:.3f}, {ydata[ind]:.3f}')

    cid = fig.canvas.mpl_connect('pick_event', on_pick)
c                    > Uc  UR                   n[        TU ]	  XU5        X0l        X@l        U R
                  R                  U5        g r   )r;  rC   rD   
mouseeventartist__dict__update)rJ   ro  r:  r  r  r;  r9  rK   s          r4   rD   PickEvent.__init__  s?    !**Hx0$V$r6   )r  r  r   rE  rI  s   @r4   r~  r~    s    $N % %r6   r~  c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )KeyEventi  ak  
A key event (key press, key release).

A KeyEvent has a number of special attributes in addition to those defined
by the parent `Event` and `LocationEvent` classes.

Attributes
----------
key : None or str
    The key(s) pressed. Could be *None*, a single case sensitive Unicode
    character ("g", "G", "#", etc.), a special key ("control", "shift",
    "f1", "up", etc.) or a combination of the above (e.g., "ctrl+alt+g",
    "ctrl+alt+G").

Notes
-----
Modifier keys will be prefixed to the pressed key and will be in the order
"ctrl", "alt", "super". The exception to this rule is when the pressed key
is itself a modifier key, therefore "ctrl+alt" and "alt+control" can both
be valid key values.

Examples
--------
::

    def on_key(event):
        print('you pressed', event.key, event.xdata, event.ydata)

    cid = fig.canvas.mpl_connect('key_press_event', on_key)
c                 0   > [         TU ]  XXEUS9  X0l        g rR  )rC   rD   ru  )rJ   ro  r:  ru  rl   rm   r;  rK   s          r4   rD   KeyEvent.__init__  s    qh?r6   )ru  )r   r   NrE  rI  s   @r4   r  r    s    > r6   r  c                     U R                   S:X  a  U R                  U R                  l        g U R                   S:X  a  S U R                  l        g g )Nkey_press_eventkey_release_event)ro  ru  r:  _key)events    r4   _key_handlerr    s=    zz&&!II	*	*  
+r6   c           	         U R                   S:X  a  U R                  U R                  l        OZU R                   S:X  a  S U R                  l        O8U R                   S:X  a(  U R                  c  U R                  R                  U l        U R                  c  U R                  R
                  U l        U R                   S:X  Ga  [        R                  nU(       a  U" 5       OS nX R                  :w  a  Ub}   UR                  SS9R                  n[        SUU R                  U R                  U R                  U R                  S9nUR                  U5        UR                  R!                  SU5        U R                  b&  U R                  R                  R!                  SU 5        U R                  (       a   [$        R&                  " U R                  5      OS [        l        g g ! ["         a     N}f = f)	Nbutton_press_eventbutton_release_eventrq  Trootaxes_leave_eventrO  axes_enter_event)ro  rt  r:  _buttonru  r  rN  r_  rS  
get_figurerl   rm   r;  rP  rW  r  r>  	Exceptionweakrefref)r  last_ref	last_axesr:  leave_events        r4   _mouse_handlerr    s{   zz))$||	-	-#	,	,1E||++yyLL%%	zz** //"*HJ	$$	&11t1<CCF"/*F%.."'//#3K  ++I6$$,,-?M ||'&&../A5I).GKK%4 	$- +$ ! s   3A<G   
G-,G-c                   ^  " S S[         5      mU4S jn[        R                  " XS9   [        5        nUcD  U R                  R                  5       nUR                  U R                  R                  U5      5      n U" [        R                  " 5       5        [        U S35      e! T a,  nUR                  u  nUs SnAsSSS5        sSSS5        $ SnAff = f! , (       d  f       O= fSSS5        g! , (       d  f       g= f)z
Get the renderer that would be used to save a `.Figure`.

If you need a renderer without any active draw methods use
renderer._draw_disabled to temporary patch them out at your call site.
c                       \ rS rSrSrg)_get_renderer.<locals>.Donei  rN   N)rB  rC  rD  rE  rG  rN   r6   r4   Doner    s    r6   r  c                    > T" U 5      er   rN   )r  r  s    r4   _draw_get_renderer.<locals>._draw  s    tH~-r6   )drawNz6 did not call Figure.draw, so no renderer is available)r  r   r   r   r:  get_default_filetypeenter_context&_switch_canvas_and_return_print_methodioBytesIORuntimeErrorr8  )figureprint_methodr  stackfmtexcr  r  s          @r4   _get_rendererr    s    y  .			6	.	u--446C !..DDSIKL	<&
 , 0:  ; < <	  	IHO 1<	.	.	 1<	.	.	.sS   C7AC?B(C(C.C=C>C	C7CC
C+	'C77
Dc                 $    U R                  5         g r   )draw_without_rendering)r  s    r4   _no_output_drawr  /  s     !!#r6   c                     [        U S5      =(       a.    U R                  SL=(       a    [        U R                  SS5      SL $ )a6  
Return whether we are in a terminal IPython, but non interactive.

When in _terminal_ IPython, ip.parent will have and `interact` attribute,
if this attribute is False we do not setup eventloop integration as the
user will _not_ interact with IPython. In all other case (ZMQKernel, or is
interactive), we do.
parentNinteractF)hasattrr  getattr)ips    r4   $_is_non_interactive_terminal_ipythonr  5  s>     B! >$&>		:t4=?r6   c              #   v  ^^#    [         R                  " [         R                  5      nUS[         R                  [         R                  4;   a  Sv   gSm[
        R                  " 5       u  p4UR                  S5        UR                  S5        [         R                  " UR                  5       5      nU " U5      nUU4S jn[         R                   " [         R                  U5         Sv   UR                  5         UR                  5         [         R                  " U5        [         R                   " [         R                  U5        Tb  U" T6   gg! UR                  5         UR                  5         [         R                  " U5        [         R                   " [         R                  U5        Tb  U" T6   f f = f7f)a/  
A context manager that allows terminating a plot by sending a SIGINT.  It
is necessary because the running backend prevents the Python interpreter
from running and processing signals (i.e., to raise a KeyboardInterrupt).
To solve this, one needs to somehow wake up the interpreter and make it
close the plot window.  We do this by using the signal.set_wakeup_fd()
function which organizes a write of the signal number into a socketpair.
A backend-specific function, *prepare_notifier*, arranges to listen to
the pair's read socket while the event loop is running.  (If it returns a
notifier object, that object is kept alive while the context manager runs.)

If SIGINT was indeed caught, after exiting the on_signal() function the
interpreter reacts to the signal according to the handler function which
had been set up by a signal.signal() call; here, we arrange to call the
backend-specific *handle_sigint* function.  Finally, we call the old SIGINT
handler with the same arguments that were given to our custom handler.

We do this only if the old handler for SIGINT was not None, which means
that a non-python handler was installed, i.e. in Julia, and not SIG_IGN
which means we should ignore the interrupts.

Parameters
----------
prepare_notifier : Callable[[socket.socket], object]
handle_sigint : Callable[[], object]
NFc                     > U mT" 5         g r   rN   )r8  handle_siginthandler_argss    r4   save_args_and_handle_sigint5_allow_interrupt.<locals>.save_args_and_handle_sigintl  s    r6   )signal	getsignalSIGINTSIG_IGNSIG_DFLsocket
socketpairsetblockingset_wakeup_fdfilenoclose)	prepare_notifierr  old_sigint_handlerwsockrsockold_wakeup_fdnotifierr  r  s	    `      @r4   _allow_interruptr  C  s<    :  ))&--8dFNNFNNCCL$$&LE	e	e((8M&H
 MM&--!<=.]+fmm%78#- $	 	]+fmm%78#- $s    C"F9'E +A%F9A&F66F9c                      ^  \ rS rSrSrSr\R                  " S 5      r/ SQr	Sr
\r\R                  S 5       rS)U 4S jjr\" S 5      r\" S	 5      r\" S
 5      r\\R*                  S 5       5       r\S 5       r\S 5       rS rS)S jrS rS rS rS rS r S r!\S 5       r"S r#SS.S jr$\S 5       r%\S 5       r&\S)S j5       r'  S*SSSSS.S jjr(\S  5       r)S! r*S" r+S# r,\-r.S+S$ jr/S% r0S,S& jr1S' r2S(r3U =r4$ )-FigureCanvasBasei}  z
The canvas the figure renders into.

Attributes
----------
figure : `~matplotlib.figure.Figure`
    A high-level figure instance.
Nc                     [         $ r   )FigureManagerBaseclss    r4   r:  FigureCanvasBase.<lambda>  s    3Dr6   )resize_event
draw_eventr  r  r  r  rn  rq  
pick_eventfigure_enter_eventfigure_leave_eventr  r  close_eventc                 @    [        U S5      =(       a    [        U S5      $ )z+If this Canvas sub-class supports blitting.copy_from_bboxrestore_region)r  r  s    r4   supports_blitFigureCanvasBase.supports_blit  s$     -. 3C!12	4r6   c                 d  > SSK Jn  U R                  5         SU l        SU l        Uc  U" 5       nUR                  U 5        Xl        S U l        [        R                  " 5       U l
        S U l        S U l        S U l        S U l        SU l        UR                  Ul        SU l        [$        TU ]M  5         g )Nr   FigureTFr   )matplotlib.figurer  _fix_ipython_backend2gui_is_idle_drawing
_is_saving
set_canvasr  managerr   LockDraw
widgetlockr  r  rX  toolbarr  _original_dpi_device_pixel_ratiorC   rD   )rJ   r  r  rK   s      r4   rD   FigureCanvasBase.__init__  s    ,%%' $>XF$!**,	! %%zz#$ r6   c                 .    U R                   R                  $ r   )r  _canvas_callbacksr   s    r4   r:  r    s    dkk&C&Cr6   c                 .    U R                   R                  $ r   )r  _button_pick_idr   s    r4   r:  r        4;;+F+Fr6   c                 .    U R                   R                  $ r   )r  _scroll_pick_idr   s    r4   r:  r    r  r6   c                    [         R                  R                  S5      nUb  UR                  S S S:  a  g SS KnUR                  5       nU(       d  g SSKJn  [        US5      (       a  [        US5      (       d  g SS	S
SSS.R                  U R                  5      nU(       a#  [        U5      (       a  UR                  U5        g g g )NIPythonrb  )rc     r   )
pylabtoolsbackend2guienable_matplotlibqtgtk3gtk4wxosx)r  r  r  r  macosx)sysmodulesgetversion_infor  get_ipythonIPython.corer   r  required_interactive_frameworkr  
enable_gui)r  mod_ipythonr  r  ptbackend2gui_rifs         r4   r  )FigureCanvasBase._fix_ipython_backend2gui  s     kkooi0+":":2A">'"I   "1M**r#677 
 #c00
1 	 3B77o. 8 r6   c                 :    U R                   R                  XU5      $ )z
Create a new figure manager for *figure*, using this canvas class.

Notes
-----
This method should not be reimplemented in subclasses.  If
custom manager creation logic is needed, please reimplement
``FigureManager.create_with_canvas``.
)manager_classcreate_with_canvas)r  r  nums      r4   new_managerFigureCanvasBase.new_manager  s       33CEEr6   c              #   J   #    SU l          S v   SU l         g ! SU l         f = f7f)NTF)r  r   s    r4   _idle_draw_cntx FigureCanvasBase._idle_draw_cntx  s%      $	*$)D!ED!s   # #	 #c                     U R                   $ )zs
Return whether the renderer is in the process of saving
to a file, rather than rendering for an on-screen buffer.
r  r   s    r4   	is_savingFigureCanvasBase.is_saving  s    
 r6   c                     g)z0Blit the canvas in bbox (default entire canvas).NrN   )rJ   bboxs     r4   blitFigureCanvasBase.blit  rS   r6   c                    U R                   R                  5        Vs/ s H>  nUR                  R                  U5      (       d  M%  UR	                  5       (       d  M<  UPM@     nnU(       a  [
        R                  " U5      nU$ SnU$ s  snf )a=  
Return the topmost visible `~.axes.Axes` containing the point *xy*.

Parameters
----------
xy : (float, float)
    (x, y) pixel positions from left/bottom of the canvas.

Returns
-------
`~matplotlib.axes.Axes` or None
    The topmost visible Axes containing the point, or None if there
    is no Axes at the point.
N)r  get_axespatchcontains_pointget_visibler   _topmost_artist)rJ   r]  a	axes_listaxess        r4   rS  FigureCanvasBase.inaxes  s|     !% 4 4 6 H 61..r2 78}}  6	 H((3D  DHs   $BBBc                 J    U R                   SU4;  a  [        S5      eXl         g)z
Set the child `~.axes.Axes` which is grabbing the mouse events.

Usually called by the widgets themselves. It is an error to call this
if the mouse is already grabbed by another Axes.
Nz&Another Axes already grabs mouse input)rX  r  rJ   axs     r4   
grab_mouseFigureCanvasBase.grab_mouse#  s(     dBZ/GHHr6   c                 2    U R                   UL a  SU l         gg)z
Release the mouse grab held by the `~.axes.Axes` *ax*.

Usually called by the widgets. It is ok to call this even if *ax*
doesn't have the mouse grab currently.
N)rX  r1  s     r4   release_mouseFigureCanvasBase.release_mouse.  s     #!%D $r6   c                     g)a  
Set the current cursor.

This may have no effect if the backend does not display anything.

If required by the backend, this method should trigger an update in
the backend event loop after the cursor is set, as this method may be
called e.g. before a long-running task during which the GUI is not
updated.

Parameters
----------
cursor : `.Cursors`
    The cursor to display over the canvas. Note: some backends may
    change the cursor for the entire window.
NrN   )rJ   cursors     r4   
set_cursorFigureCanvasBase.set_cursor8  rS   r6   c                     g)z
Render the `.Figure`.

This method must walk the artist tree, even if no output is produced,
because it triggers deferred work that users may want to access
before saving output to disk. For example computing limits,
auto-limits, and tick values.
NrN   rJ   r8  r9  s      r4   r  FigureCanvasBase.drawJ  rS   r6   c                     U R                   (       d,  U R                  5          U R                  " U0 UD6  SSS5        gg! , (       d  f       g= f)aA  
Request a widget redraw once control returns to the GUI event loop.

Even if multiple calls to `draw_idle` occur before control returns
to the GUI event loop, the figure will only be rendered once.

Notes
-----
Backends may choose to override the method and implement their own
strategy to prevent multiple renderings.

N)r  r  r  r=  s      r4   	draw_idleFigureCanvasBase.draw_idleT  s>     $$%%'		4*6* (' %''s	   ?
Ac                     U R                   $ )aa  
The ratio of physical to logical pixels used for the canvas on screen.

By default, this is 1, meaning physical and logical pixels are the same
size. Subclasses that support High DPI screens may set this property to
indicate that said ratio is different. All Matplotlib interaction,
unless working directly with the canvas, remains in logical pixels.

r  r   s    r4   device_pixel_ratio#FigureCanvasBase.device_pixel_ratioe  s     '''r6   c                     U R                   U:X  a  gXR                  R                  -  nU R                  R                  USS9  Xl         g)aP  
Set the ratio of physical to logical pixels used for the canvas.

Subclasses that support High DPI screens can set this property to
indicate that said ratio is different. The canvas itself will be
created at the physical size, while the client side will use the
logical size. Thus the DPI of the Figure will change to be scaled by
this ratio. Implementations that support High DPI screens should use
physical pixels for events so that transforms back to Axes space are
correct.

By default, this is 1, meaning physical and logical pixels are the same
size.

Parameters
----------
ratio : float
    The ratio of logical to physical pixels used for the canvas.

Returns
-------
bool
    Whether the ratio has changed. Backends may interpret this as a
    signal to resize the window, repaint the canvas, or change any
    other relevant properties.
F)forwardT)r  r  r  _set_dpi)rJ   ratior  s      r4   _set_device_pixel_ratio(FigureCanvasBase._set_device_pixel_ratior  sI    6 ##u,
 kk///S%0#( r6   F)physicalc                n   ^ ^ [        UU 4S jT R                  R                  R                   5       5      $ )a<  
Return the figure width and height in integral points or pixels.

When the figure is used on High DPI screens (and the backend supports
it), the truncation to integers occurs after scaling by the device
pixel ratio.

Parameters
----------
physical : bool, default: False
    Whether to return true physical pixels or logical pixels. Physical
    pixels may be used by backends that support HiDPI, but still
    configure the canvas using its actual size.

Returns
-------
width, height : int
    The size of the figure, in points or pixels, depending on the
    backend.
c              3   f   >#    U  H&  n[        UT(       a  S OTR                  -  5      v   M(     g7f)r   N)r  rD  ).0r  rL  rJ   s     r4   	<genexpr>4FigureCanvasBase.get_width_height.<locals>.<genexpr>  s/      7!5 hD4K4KLMM!5s   .1)tupler  r#  r   )rJ   rL  s   ``r4   r  !FigureCanvasBase.get_width_height  s/    *  7!%!1!1!5!57 7 	7r6   c                     U R                   $ )z>Return dict of savefig file formats supported by this backend.)	filetypesr  s    r4   get_supported_filetypes(FigureCanvasBase.get_supported_filetypes  s     }}r6   c                     0 nU R                   R                  5        H8  u  p#UR                  U/ 5      R                  U5        X   R	                  5         M:     U$ )z
Return a dict of savefig file formats supported by this backend,
where the keys are a file type name, such as 'Joint Photographic
Experts Group', and the values are a list of filename extensions used
for that filetype, such as ['jpg', 'jpeg'].
)rU  items
setdefaultr  sort)r  	groupingsextro  s       r4   get_supported_filetypes_grouped0FigureCanvasBase.get_supported_filetypes_grouped  sS     	,,.IC  r*11#6O  " / r6   c              #     ^	^
#    SnUb[  SSK Jn  UR                  U5      R                  n[	        USU 35      (       d  [        SU< SU S35      eU" U R                  5      nOx[	        U SU 35      (       a  U nOa[        U5      nUcA  [        SR                  US	R                  [        U R                  5       5      5      5      5      eU" U R                  5      nU R                  Ul        [        USU 35      m	[	        T	S
5      (       a  T	R                  R                  OT	R                  nUR!                  S5      (       aK  1 SknU1 ["        R$                  " T	5      R&                  k-
  m
[(        R*                  " T	5      " U	U
4S j5      nOT	n Uv   X R                  l        g! X R                  l        f = f7f)an  
Context manager temporarily setting the canvas for saving the figure::

    with (canvas._switch_canvas_and_return_print_method(fmt, backend)
          as print_method):
        # ``print_method`` is a suitable ``print_{fmt}`` method, and
        # the figure's canvas is temporarily switched to the method's
        # canvas within the with... block.  ``print_method`` is also
        # wrapped to suppress extra kwargs passed by ``print_figure``.

Parameters
----------
fmt : str
    If *backend* is None, then determine a suitable canvas class for
    saving to format *fmt* -- either the current canvas class, if it
    supports *fmt*, or whatever `get_registered_canvas_class` returns;
    switch the figure canvas to that canvas class.
backend : str or None, default: None
    If not None, switch the figure canvas to the ``FigureCanvas`` class
    of the given backend.
Nr   )backend_registryprint_zThe z backend does not support z outputz4Format {!r} is not supported (supported formats: {})rz  r  )zmatplotlib.zmpl_toolkits.>   r  	edgecolor	facecolororientationbbox_inches_restorec            
      v   > T" U 0 UR                  5        VVs0 s H  u  p#UT;  d  M  X#_M     snnD6$ s  snnf r   )rY  )r8  r9  kvmethskips       r4   r:  IFigureCanvasBase._switch_canvas_and_return_print_method.<locals>.<lambda>  s=    JM+1<<>K>41Qd]$!$>KJMKs   55)backends.registryra  load_backend_moduler<   r  r  r  r>   r1   joinsortedrV  r  r  r  rC  r=  inspect	signature
parameters	functoolswrapsr:  )rJ   r  r2   r:  ra  canvas_classmodoptional_kwsr  rj  rk  s            @@r4   r  7FigureCanvasBase._switch_canvas_and_return_print_method  s    . ;+??HUUL<6#88 7+%?uGLN N!$++.FTVC5>**F 7s;L# JQQTYYvd.J.J.L'MNPQ Q "$++.F OOvu~.$'' yy##OO 	 >>:;;'L  "GG$5$5d$;$F$F"GGD$??40 2M NL  L	&!%KKKKs   FF>F) F>)F;;F>)bbox_inches
pad_inchesbbox_extra_artistsr2   c                	   Uc  [        U[        R                  5      (       a  [        R                  " U5      n[        U[        5      (       a%  [        R
                  R                  U5      S   SS nUb  US:X  a<  U R                  5       n[        U[        5      (       a  UR                  S5      S-   U-   nUR                  5       nUc	  [        S   nUS:X  a+  [        U R                  SU R                  R                  5      n[        R                  " U SS9   U R!                  Xj5       n[        R                  " U R                  US	9   [        R                  " U R                  R"                  SS
9   [        R                  " U R                  R"                  SS9   [%        5        nS Hi  n['        5       U   nUc  [        SU 3   n[        R(                  " US5      (       a  M=  UR+                  U R                  R,                  " S0 X0D65        Mk     Uc	  [        S   nU R                  R/                  5       nUc  US:X  ab  [1        U R                  [2        R4                  " XS95      n[        US[6        5      " 5          U R                  R9                  U5        SSS5        U(       a  US:X  a  U R                  R;                  WU	S9n[        U[<        5      (       a-  US:X  a'  UR?                  5       S   nUR?                  5       S   nOUS;   a	  [        S   nU=nnURA                  UU5      n[B        RD                  " U R                  XpR                  R"                  RF                  5      nUU4nOSnUR+                  U R                  R-                  SS95         [        R                  " U R                  US	9   U" U4UUUUS.UD6nSSS5        U(       a  W(       a  U" 5         WsSSS5        sSSS5        sSSS5        sSSS5        sSSS5        sSSS5        $ ! , (       d  f       GN= f! , (       d  f       Nm= f! U(       a  W(       a  U" 5         f f f = f! , (       d  f       O= f SSS5        O! , (       d  f       O= fSSS5        O! , (       d  f       O= fSSS5        O! , (       d  f       O= fSSS5        O! , (       d  f       O= fSSS5        g! , (       d  f       g= f)a+  
Render the figure to hardcopy. Set the figure patch face and edge
colors.  This is useful because some of the GUIs have a gray figure
face color background and you'll probably want to override this on
hardcopy.

Parameters
----------
filename : str or path-like or file-like
    The file where the figure is saved.

dpi : float, default: :rc:`savefig.dpi`
    The dots per inch to save the figure in.

facecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.facecolor`
    The facecolor of the figure.  If 'auto', use the current figure
    facecolor.

edgecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.edgecolor`
    The edgecolor of the figure.  If 'auto', use the current figure
    edgecolor.

orientation : {'landscape', 'portrait'}, default: 'portrait'
    Only currently applies to PostScript printing.

format : str, optional
    Force a specific file format. If not given, the format is inferred
    from the *filename* extension, and if that fails from
    :rc:`savefig.format`.

bbox_inches : 'tight' or `.Bbox`, default: :rc:`savefig.bbox`
    Bounding box in inches: only the given portion of the figure is
    saved.  If 'tight', try to figure out the tight bbox of the figure.

pad_inches : float or 'layout', default: :rc:`savefig.pad_inches`
    Amount of padding in inches around the figure when bbox_inches is
    'tight'. If 'layout' use the padding from the constrained or
    compressed layout engine; ignored if one of those engines is not in
    use.

bbox_extra_artists : list of `~matplotlib.artist.Artist`, optional
    A list of extra artists that will be considered when the
    tight bbox is calculated.

backend : str, optional
    Use a non-default backend to render the file, e.g. to render a
    png file with the "cairo" backend rather than the default "agg",
    or a pdf file with the "pgf" backend rather than the default
    "pdf".  Note that the default backend is normally sufficient.  See
    :ref:`the-builtin-backends` for a list of valid backends for each
    file format.  Custom backends can be referenced as "module://...".
Nr   r.   .zsavefig.dpir  r  )r  )r  rC  Tr  )rd  rc  zsavefig.autozsavefig.bboxtight)re  r@  )r|  layouth_padw_pad)Nr  zsavefig.pad_inchesnone)layout_engine)rd  rc  re  rf  rN   )$r8   osPathLikefspathr9   r\   splitextr  rstriplowerr   r  r  r  r   r   r  r:  r   locals
_str_equalr  _cm_setget_layout_enginer  rt  partialr   r  get_tightbboxr   r  paddedr   adjust_bbox	fixed_dpi)rJ   filenamer  rd  rc  re  r1   rz  r{  r|  r2   r9  r  r  r   r  r  r  r  r  restore_bbox_bbox_inches_restoreresults                          r4   print_figureFigureCanvasBase.print_figure  s   r >(BKK0099X.(C(())(3A6qr:~2224h,,'s3c9FBH;=)C(?$++HC d399&J 5 2 2J 2 2tDkU2=$xv%67E''v66''(;(;(Ltm(LM 3 "&~6 KK99;M(K7,B )KK%%$? X'7EGKK$$X. H')"&++";"; 5G #< #IK"=2IJJ&(2 - 1 1 3G < - 1 1 3G <%)99)12F)GJ(22"-"4"4UE"BK  +66KKkk.@.@.J.J L )4\'B$'+$  3 3& 3 IJ# &&t{{<) ""+"+$/,@" !"F = < NC k ED KJ 65 KJ 43< HG: =< < N $0;} kk EDD KJJ 655 KJJ 433s   S., S*R:6*R 	 R+<Q++BQ+P,$DQ+)QP>QQ+5	R>	R 		R:	S	S.,
P;6Q+>
QQQ((Q++
Q95R=	R 	
RR 		R: 
R.*R:1	S:
SS	S.
S"	S..
S<c                     [         S   $ )z
Return the default savefig file format as specified in
:rc:`savefig.format`.

The returned string does not include a period. This method is
overridden in backends that only support a single file type.
zsavefig.format)r   r  s    r4   r  %FigureCanvasBase.get_default_filetype  s     ())r6   c                     U R                   b  U R                   R                  5       OSnU=(       d    SnSnUR                  U Vs0 s H  n[        U5      S_M     sn5      nU R	                  5       nU SU 3$ s  snf )z>
Return a suitable default filename, including the extension.
r.   imagez<>:"/\|?*\0 _r~  )r  get_window_titlerf   ordr  )rJ   default_basenameremoved_charsr(  default_filetypes        r4   get_default_filename%FigureCanvasBase.get_default_filename  s     ||' LL))+ 	
 ,6w (+55"/0-QSVS[-02446"#1%5$677 1s   A:c                 8    U R                   R                  X5      $ )a0  
Bind function *func* to event *s*.

Parameters
----------
s : str
    One of the following events ids:

    - 'button_press_event'
    - 'button_release_event'
    - 'draw_event'
    - 'key_press_event'
    - 'key_release_event'
    - 'motion_notify_event'
    - 'pick_event'
    - 'resize_event'
    - 'scroll_event'
    - 'figure_enter_event',
    - 'figure_leave_event',
    - 'axes_enter_event',
    - 'axes_leave_event'
    - 'close_event'.

func : callable
    The callback function to be executed, which must have the
    signature::

        def func(event: Event) -> Any

    For the location events (button and key press/release), if the
    mouse is over the Axes, the ``inaxes`` attribute of the event will
    be set to the `~matplotlib.axes.Axes` the event occurs is over, and
    additionally, the variables ``xdata`` and ``ydata`` attributes will
    be set to the mouse location in data coordinates.  See `.KeyEvent`
    and `.MouseEvent` for more info.

    .. note::

        If func is a method, this only stores a weak reference to the
        method. Thus, the figure does not influence the lifetime of
        the associated object. Usually, you want to make sure that the
        object is kept alive throughout the lifetime of the figure by
        holding a reference to it.

Returns
-------
cid
    A connection id that can be used with
    `.FigureCanvasBase.mpl_disconnect`.

Examples
--------
::

    def on_press(event):
        print('you pressed', event.button, event.xdata, event.ydata)

    cid = canvas.mpl_connect('button_press_event', on_press)
)r  connect)rJ   rO   r  s      r4   mpl_connectFigureCanvasBase.mpl_connect  s    z ~~%%a..r6   c                 :    U R                   R                  U5        g)z
Disconnect the callback with id *cid*.

Examples
--------
::

    cid = canvas.mpl_connect('button_press_event', on_press)
    # ... later
    canvas.mpl_disconnect(cid)
N)r  
disconnect)rJ   cids     r4   mpl_disconnectFigureCanvasBase.mpl_disconnect  s     	!!#&r6   c                      U R                  XS9$ )aP  
Create a new backend-specific subclass of `.Timer`.

This is useful for getting periodic events through the backend's native
event loop.  Implemented only for backends with GUIs.

Parameters
----------
interval : int
    Timer interval in milliseconds.

callbacks : list[tuple[callable, tuple, dict]]
    Sequence of (func, args, kwargs) where ``func(*args, **kwargs)``
    will be executed by the timer every *interval*.

    Callbacks which return ``False`` or ``0`` will be removed from the
    timer.

Examples
--------
>>> timer = fig.canvas.new_timer(callbacks=[(f1, (1,), {'a': 3})])
)r  r  )
_timer_clsr  s      r4   	new_timerFigureCanvasBase.new_timer	  s    . FFr6   c                     g)z]
Flush the GUI events for the figure.

Interactive backends need to reimplement this method.
NrN   r   s    r4   flush_eventsFigureCanvasBase.flush_events	  rS   r6   c                 
   US::  a  [         R                  nSnSnSU l        U R                  (       aQ  X2-  U:  aH  U R                  5         [        R
                  " U5        US-  nU R                  (       a  X2-  U:  a  MF  gggg)a  
Start a blocking event loop.

Such an event loop is used by interactive functions, such as
`~.Figure.ginput` and `~.Figure.waitforbuttonpress`, to wait for
events.

The event loop blocks until a callback function triggers
`stop_event_loop`, or *timeout* is reached.

If *timeout* is 0 or negative, never timeout.

Only interactive backends need to reimplement this method and it relies
on `flush_events` being properly implemented.

Interactive backends should implement this in a more native way.
r   g{Gz?Tr   N)r   inf_loopingr  timesleep)rJ   timeouttimestepcounters       r4   start_event_loop!FigureCanvasBase.start_event_loop$	  sq    $ a<ffGmm 2W <JJx qLG mm 2W <m <mr6   c                     SU l         g)zr
Stop the current blocking event loop.

Interactive backends need to reimplement this to match
`start_event_loop`
FN)r  r   s    r4   stop_event_loop FigureCanvasBase.stop_event_loop@	  s     r6   )r  r  r  r  r  r  r  r  rX  r  r  r   )NNNportraitNrw  )r   )5rB  rC  rD  rE  rF  r  r
   classpropertyr  eventsr  r0   rU  r  rD   r5  r  button_pick_idscroll_pick_idclassmethodrt  cacher  r  r   r  r   r$  rS  r3  r6  r:  r  r@  rD  rJ  r  rV  r^  r  r  r  r  r  r  r  r  r  r  r  r  rG  rH  rI  s   @r4   r  r  }  s    &*" &&'DEMF" I"I	4 4
* CDIFGNFGN__"/  "/H 
F 
F * *?0	 &$+" 
( 
($L ,1 70     ;& ;&| AE+/R $	Rh * *8&=/~'  JG28 r6   r  c                    U R                   c  gUc  U R                  nUc  UR                  nU R                   [        S   ;   a   UR                  R                  5         U R                   [        S   ;   a   [        R                  " UR                  5        U R                   [        S   ;   a  [        R                  " 5         UGb  U R                   [        S   ;   a  UR                  5         OU R                   [        S   ;   a  UR                  5         OU R                   [        S   ;   a  UR                  5         OU R                   [        S   ;   a"  UR                  5         UR                  U 5        O`U R                   [        S	   ;   a"  UR!                  5         UR                  U 5        O'U R                   [        S
   ;   a  UR#                  5         U R$                  c  gS nU R$                  nU R                   [        S   ;   a  SU" UR&                  R(                  5      U" UR*                  R(                  5      4;  a  U" UR&                  R,                  5      nU" UR*                  R,                  5      n/ SQn XwR/                  XV45      S-   [1        U5      -     u  pVUR3                  XU(       a  SOSSS9  UR3                  Xf(       a  SOSSS9  UR5                  5         U R                   [        S   ;   a  SU" UR&                  R,                  5      U" UR*                  R,                  5      4;  a  U" UR&                  R(                  5      nU" UR*                  R(                  5      n/ SQn XwR/                  XV45      S-   [1        U5      -     u  pVUR3                  USSS9  UR3                  USSS9  UR5                  5         gU R                   [        S   ;   a  UR9                  5       nUS:X  a9  UR;                  S5        UR=                  SS9R                  R5                  5         gUS:X  a:   UR;                  S5        UR=                  SS9R                  R5                  5         ggU R                   [        S   ;   a  URE                  5       n
U
S:X  a9  URG                  S5        UR=                  SS9R                  R5                  5         gU
S:X  a:   URG                  S5        UR=                  SS9R                  R5                  5         ggg! [         a     GNf = f! [6         a     GNUf = f! [6         a     gf = f! [6         a:  n	[>        RA                  [C        U	5      5        UR;                  S5         Sn	A	GNBSn	A	ff = f! [6         a9  n	[>        RA                  [C        U	5      5        URG                  S5         Sn	A	NSn	A	ff = f)ak  
Implement the default Matplotlib key bindings for the canvas and toolbar
described at :ref:`key-event-handling`.

Parameters
----------
event : `KeyEvent`
    A key press/release event.
canvas : `FigureCanvasBase`, default: ``event.canvas``
    The backend-specific canvas instance.  This parameter is kept for
    back-compatibility, but, if set, should always be equal to
    ``event.canvas``.
toolbar : `NavigationToolbar2`, default: ``event.canvas.toolbar``
    The navigation cursor toolbar.  This parameter is kept for
    back-compatibility, but, if set, should always be equal to
    ``event.canvas.toolbar``.
Nzkeymap.fullscreenzkeymap.quitzkeymap.quit_allzkeymap.homekeymap.backkeymap.forwardz
keymap.panzkeymap.zoomzkeymap.savec                 j    [        S U  5       5      (       a  S$ [        S U  5       5      (       d  S$ S $ )Nc              3   T   #    U  H  oR                   R                  5       v   M      g 7fr   gridliner*  rO  ticks     r4   rP  Dkey_press_handler.<locals>._get_uniform_gridstate.<locals>.<genexpr>	  s     JEDMM5577E   &(Tc              3   T   #    U  H  oR                   R                  5       v   M      g 7fr   r  r  s     r4   rP  r  	  s      O!:!:!<!<r  F)ry  r  )tickss    r4   _get_uniform_gridstate1key_press_handler.<locals>._get_uniform_gridstate	  s<     JEJJJ 	  O OOO		r6   zkeymap.grid))FF)TF)TT)FTr   majorbothrl   )whichaxisrm   zkeymap.grid_minorzkeymap.yscaleloglinearTr  zkeymap.xscale)$ru  r:  r  r   r  full_screen_toggleAttributeErrorr   destroy_figr  destroy_allhomebackrG  pan_update_cursorzoomsave_figurerS  xaxis
minorTicksyaxis
majorTicksr'  re   gridr@  r  
get_yscale
set_yscaler  rz  r{  r9   
get_xscale
set_xscale)r  r:  r  r  r2  x_statey_stater   r   r  scalexs              r4   key_press_handlerr  J	  s   $ yy~.. yyH011	NN--/
 yyH]++&yyH.//99//LLN YY(=11LLNYY(#344OOYY(<00KKM""5)YY(=11LLN""5)YY(=11!|| 
B
 			Xm,,3BHH4G4GH3BHH4G4GHJ J()<)<=()<)<=L
	{{G#56:c%jHI G GGGg76GLGGGg76GL		X1223BHH4G4GH3BHH4G4GHJ J()<)<=()<)<=L		{{G#56:c%jHI G GGG6G4GGG6G4	h/	/E>MM(#MMtM$++557h(e$ MMtM$++557  
h/	/U?MM(#MMtM$++557x(e$ MMtM$++557   
0E  		t  		&  		   (SX&h''(  (SX&h''(sf   T" %T3 ;%U  U 'V "
T0/T03
U U
UU
V/VV
W%/WWc                     Uc  U R                   nUc  UR                  nUb[  [        [        U R                  5      5      nU[
        S   ;   a  UR                  5         gU[
        S   ;   a  UR                  5         ggg)z
The default Matplotlib button actions for extra mouse buttons.

Parameters are as for `key_press_handler`, except that *event* is a
`MouseEvent`.
Nr  r  )r:  r  r9   ra  rt  r   r  rG  )r  r:  r  button_names       r4   button_press_handlerr  	  sq     ~..+ell34(=11LLNH%566OO 7	 r6   c                       \ rS rSrSrSrg)NonGuiExceptioni	  z6Raised when trying show a figure in a non-GUI backend.rN   NrL  rN   r6   r4   r  r  	  s    @r6   r  c                       \ rS rSrSrSrSrS r\S 5       r	\S 5       r
\SS.S j5       rS	 rS
 rS rS rS rS rSrg)r  i	  ae  
A backend-independent abstraction of a figure container and controller.

The figure manager is used by pyplot to interact with the window in a
backend-independent way. It's an adapter for the real (GUI) framework that
represents the visual figure on screen.

The figure manager is connected to a specific canvas instance, which in turn
is connected to a specific figure instance. To access a figure manager for
a given figure in user code, you typically use ``fig.canvas.manager``.

GUI backends derive from this class to translate common operations such
as *show* or *resize* to the GUI-specific code. Non-GUI backends do not
support these operations and can just use the base class.

This following basic operations are accessible:

**Window operations**

- `~.FigureManagerBase.show`
- `~.FigureManagerBase.destroy`
- `~.FigureManagerBase.full_screen_toggle`
- `~.FigureManagerBase.resize`
- `~.FigureManagerBase.get_window_title`
- `~.FigureManagerBase.set_window_title`

**Key and mouse button press handling**

The figure manager sets up default key and mouse button press handling by
hooking up the `.key_press_handler` to the matplotlib event system. This
ensures the same shortcuts and mouse actions across backends.

**Other operations**

Subclasses will have additional attributes and functions to access
additional functionality. This is of course backend-specific. For example,
most GUI backends have ``window`` and ``toolbar`` attributes that give
access to the native GUI widgets of the respective framework.

Attributes
----------
canvas : `FigureCanvasBase`
    The backend-specific canvas instance.

num : int or str
    The figure number.

key_press_handler_id : int
    The default key handler cid, when using the toolmanager.
    To disable the default key press handling use::

        figure.canvas.mpl_disconnect(
            figure.canvas.manager.key_press_handler_id)

button_press_handler_id : int
    The default mouse button handler cid, when using the toolmanager.
    To disable the default button press handling use::

        figure.canvas.mpl_disconnect(
            figure.canvas.manager.button_press_handler_id)
Nc                   ^  UT l         T Ul        UT l        T R                  SUS 35        S T l        S T l        [        S   S:w  aJ  T R                   R                  S[        5      T l        T R                   R                  S[        5      T l        [        R                  S   S:X  a  [        UR                  5      OS T l        [        R                  S   S:X  a2  T R                  (       a!  T R                  T R                   5      T l        OP[        R                  S   S:X  a2  T R                   (       a!  T R!                  T R                  5      T l        OS T l        T R                  (       aQ  ["        R$                  " T R                  5        T R                  (       a   ["        R&                  " T R                  5        T R                   R                  R(                  U 4S j5       ng )	NzFigure r  r  toolmanagerr  r  toolbar2c                 r   > TR                   c)  TR                  b  TR                  R                  5         g g g r   )r  r  r  )figrJ   s    r4   notify_axes_change6FigureManagerBase.__init__.<locals>.notify_axes_changeP
  s3     'DLL,D##% -E'r6   )r:  r  r  set_window_titlekey_press_handler_idbutton_press_handler_idr   r  r  r  mplr   r  r  _toolbar2_classr  _toolmanager_toolbar_classtoolsadd_tools_to_manageradd_tools_to_containeradd_axobserver)rJ   r:  r  r  s   `   r4   rD   FigureManagerBase.__init__1
  su   Aw/0$(!'+$I-/(,(?(?!#4)6D%+/;;+B+B$&:,<D(  #||I6-G (6!% 	 LL#z1((//<DLll9%633::4;K;KLDLDL&&t'7'78||,,T\\:				*	*	& 
+	&r6   c                      U " U" U5      U5      $ )z
Create a manager for a given *figure* using a specific *canvas_class*.

Backends should override this method if they have specific needs for
setting up the canvas or the manager.
rN   )r  rv  r  r  s       r4   r  $FigureManagerBase.create_with_canvasV
  s     <'--r6   c                     g)aj  
Start the main event loop.

This method is called by `.FigureManagerBase.pyplot_show`, which is the
implementation of `.pyplot.show`.  To customize the behavior of
`.pyplot.show`, interactive backends should usually override
`~.FigureManagerBase.start_main_loop`; if more customized logic is
necessary, `~.FigureManagerBase.pyplot_show` can also be overridden.
NrN   r  s    r4   start_main_loop!FigureManagerBase.start_main_loop`
  rS   r6   blockc                   [         R                  " 5       nU(       d  gU H  n UR                  5         M     UcS  [        [        R                  R                  S5      SS5      n[        US5      nU(       + =(       a    [        5       (       + nU(       a  U R                  5         gg! [         a*  n[        R
                  " [        U5      5         SnAM  SnAff = f)a  
Show all figures.  This method is the implementation of `.pyplot.show`.

To customize the behavior of `.pyplot.show`, interactive backends
should usually override `~.FigureManagerBase.start_main_loop`; if more
customized logic is necessary, `~.FigureManagerBase.pyplot_show` can
also be overridden.

Parameters
----------
block : bool, optional
    Whether to block by calling ``start_main_loop``.  The default,
    None, means to block if we are neither in IPython's ``%pylab`` mode
    nor in ``interactive`` mode.
Nmatplotlib.pyplotshow	_needmain)r   get_all_fig_managersr  r  r
   warn_externalr9   r  r	  r
  r  r  r   r  r  r  managersr  r  pyplot_showipython_pylabs          r4   r  FigureManagerBase.pyplot_showl
  s    " ++-G-  
 = "#++//2E"FPTUK#K=M%%>n.>*>E!  # -""3s8,,-s   B''
C1CCc                     [         R                  S:X  a%  [        R                  R	                  S5      (       d  g[        [        U R                  5      R                   S35      e)z
For GUI backends, show the figure window and redraw.
For non-GUI backends, raise an exception, unless running headless (i.e.
on Linux with an unset DISPLAY); this exception is converted to a
warning in `.Figure.show`.
linuxDISPLAYNz- is non-interactive, and thus cannot be shown)	r	  platformr  environr  r  typer:  rB  r   s    r4   r  FigureManagerBase.show
  sS     <<7"2::>>)+D+D
 DKK ))* +  	r6   c                     g r   rN   r   s    r4   destroyFigureManagerBase.destroy
  r  r6   c                     g r   rN   r   s    r4   r  $FigureManagerBase.full_screen_toggle
  r  r6   c                     g)z9For GUI backends, resize the window (in physical pixels).NrN   )rJ   r  r  s      r4   resizeFigureManagerBase.resize
  rS   r6   c                     g)zp
Return the title text of the window containing the figure, or None
if there is no window (e.g., a PS backend).
r  rN   r   s    r4   r  "FigureManagerBase.get_window_title
  s    
 r6   c                     g)z
Set the title text of the window containing the figure.

This has no effect for non-GUI (e.g., PS) backends.

Examples
--------
>>> fig = plt.figure()
>>> fig.canvas.manager.set_window_title('My figure')
NrN   )rJ   titles     r4   r  "FigureManagerBase.set_window_title
  rS   r6   )r  r:  r  r  r  r  )rB  rC  rD  rE  rF  r  r	  rD   r  r  r  r  r  r)  r  r.  r  r  rG  rN   r6   r4   r  r  	  sz    <| O!%#&J . . 	 	 "&  "  "D$H
r6   r  c                   6    \ rS rSrSrSrSrS r\S 5       r	Sr
g)	_Modei
  r.   zpan/zoomz	zoom rectc                     U R                   $ r   )valuer   s    r4   r{  _Mode.__str__
  s    zzr6   c                 D    U [         R                  La  U R                  $ S $ r   )r6  NONEro  r   s    r4   _navigate_mode_Mode._navigate_mode
  s     

2tyy<<r6   rN   N)rB  rC  rD  rE  r;  PANZOOMr{  r5  r<  rG  rN   r6   r4   r6  r6  
  s*    D
CD = =r6   r6  c                      \ rS rSrSrSr\" 5       rS rS r	S r
S rS rS	 rS
 rS r\S 5       r\S 5       rS rS rS rS r\" SS5      rS rS rS rS r\" SS5      rS rS r S r!S r"S r#S r$S  r%S! r&S" r'S#r(g$)%NavigationToolbar2i
  a  
Base class for the navigation cursor, version 2.

Backends must implement a canvas that handles connections for
'button_press_event' and 'button_release_event'.  See
:meth:`FigureCanvasBase.mpl_connect` for more information.

They must also define

:meth:`save_figure`
    Save the current figure.

:meth:`draw_rubberband` (optional)
    Draw the zoom to rect "rubberband" rectangle.

:meth:`set_message` (optional)
    Display message.

:meth:`set_history_buttons` (optional)
    You can change the history back / forward buttons to indicate disabled / enabled
    state.

and override ``__init__`` to set up the toolbar -- without forgetting to
call the base-class init.  Typically, ``__init__`` needs to set up toolbar
buttons connected to the `home`, `back`, `forward`, `pan`, `zoom`, and
`save_figure` methods and using standard icons in the "images" subdirectory
of the data path.

That's it, we'll do the rest!
)	)HomezReset original viewr  r  )BackzBack to previous viewr  r  )ForwardzForward to next viewrG  rG  NNNN)PanzFLeft button pans, Right button zooms
x/y fixes axis, CTRL fixes aspectmover  )Zoomz Zoom to rectangle
x/y fixes axiszoom_to_rectr  )SubplotszConfigure subplotssubplotsconfigure_subplotsrE  )SavezSave the figurefilesaver  c                    Xl         Xl        [        R                  " 5       U l        [
        R                  R                  U l        U R                   R                  SU R                  5      U l        U R                   R                  SU R                  5      U l        U R                   R                  SU R                  5      U l        S U l        S U l        ["        R$                  U l        U R)                  5         g )Nr  r  rq  )r:  r  r   _Stack
_nav_stackr
  CursorsPOINTER_last_cursorr  _zoom_pan_handler	_id_press_id_release
mouse_move_id_drag	_pan_info
_zoom_infor6  r;  modeset_history_buttons)rJ   r:  s     r4   rD   NavigationToolbar2.__init__  s    ,,.!MM1100 $"8"8:;;22"D$:$:<//!4??4JJ	  "r6   c                     g)z.Display a message on toolbar or in status bar.NrN   rU   s     r4   set_messageNavigationToolbar2.set_message  rS   r6   c                     g)zz
Draw a rectangle rubberband to indicate zoom limits.

Note that it is not guaranteed that ``x0 <= x1`` and ``y0 <= y1``.
NrN   )rJ   r  x0y0x1y1s         r4   draw_rubberband"NavigationToolbar2.draw_rubberband  rS   r6   c                     g)zRemove the rubberband.NrN   r   s    r4   remove_rubberband$NavigationToolbar2.remove_rubberband#  rS   r6   c                 x    U R                   R                  5         U R                  5         U R                  5         g)z
Restore the original view.

For convenience of being directly connected as a GUI callback, which
often get passed additional parameters, this method accepts arbitrary
parameters, but does not use them.
N)rQ  r  r]  _update_viewrJ   r8  s     r4   r  NavigationToolbar2.home&  ,     	  "r6   c                 x    U R                   R                  5         U R                  5         U R                  5         g)z
Move back up the view lim stack.

For convenience of being directly connected as a GUI callback, which
often get passed additional parameters, this method accepts arbitrary
parameters, but does not use them.
N)rQ  r  r]  rm  rn  s     r4   r  NavigationToolbar2.back2  rp  r6   c                 x    U R                   R                  5         U R                  5         U R                  5         g)z
Move forward in the view lim stack.

For convenience of being directly connected as a GUI callback, which
often get passed additional parameters, this method accepts arbitrary
parameters, but does not use them.
N)rQ  rG  r]  rm  rn  s     r4   rG  NavigationToolbar2.forward>  s,     	!  "r6   c                    U R                   (       Gaf  UR                  (       GaT  UR                  R                  5       (       Ga4  U R                   [        R                  :X  a{  U R
                  [        R                  R                  :w  aS  U R                  R                  [        R                  R                  5        [        R                  R                  U l        gU R                   [        R                  :X  a|  U R
                  [        R                  R                  :w  aS  U R                  R                  [        R                  R                  5        [        R                  R                  U l        gggU R
                  [        R                  R                  :w  aS  U R                  R                  [        R                  R                  5        [        R                  R                  U l        gg)zF
Update the cursor after a mouse move event or a tool (de)activation.
N)r\  rS  get_navigater6  r?  rT  r
  rR  SELECT_REGIONr:  r:  r>  MOVErS  rJ   r  s     r4   r  !NavigationToolbar2._update_cursorJ  s*    999%,,*C*C*E*E		UZZ'))U]]-H-HH&&u}}'B'BC$)MM$?$?!))uyy(''5==+=+==&&u}}'9'9:$)MM$6$6! > ) %--"7"77KK""5==#8#89 % 5 5D 8r6   c              #     #    [         R                   " 5       [        U S[        R                  * 5      sU l        nU R                  U-
  S:  a^   U R
                  R                  [        R                  R                  5        Sv   U R
                  R                  U R                  5        gSv   g! U R
                  R                  U R                  5        f = f7f)aY  
Set the cursor to a wait cursor when drawing the canvas.

In order to avoid constantly changing the cursor when the canvas
changes frequently, do nothing if this context was triggered during the
last second.  (Optimally we'd prefer only setting the wait cursor if
the *current* draw takes too long, but the current draw blocks the GUI
thread).

_draw_timer   N)r  r  r   r  r|  r:  r:  r
  rR  WAITrT  )rJ   last_draw_times     r4   _wait_cursor_for_draw_cm+NavigationToolbar2._wait_cursor_for_draw_cm[  s      IIK|bffW= 	(??^+a/:&&u}}'9'9:&&t'8'89 &&t'8'89s   AC7B0 +C0'CCc                    U R                   (       Ga2  U R                   R                  5       (       Ga   U R                   R                  U R                  U R                  5      nUR                  5       nU R                   R                   Vs/ s H7  nUR                  U 5      S   (       d  M  UR                  5       (       d  M5  UPM9     nnU(       ap  [        R                  " U5      nX R                   R                  LaB  UR                  U 5      nUb.  UR                  U5      R                  5       nU(       a  US-   U-   nU$ gs  snf ! [        [        4 a     gf = f)Nr   
r.   )rS  rv  format_coordrT  rU  r  _mouseover_setcontainsr*  r   r+  r(  get_cursor_dataformat_cursor_datar  OverflowError)r  rO   r,  artistsdatadata_strs         r4   _mouse_event_to_message*NavigationToolbar2._mouse_event_to_messageq  s$   <<<ELL5577LL--ekk5;;G HHJ&+ll&A&A H&Ajj/2 78}} &A H--g6A 2 22 007+'(';';D'A'H'H'JH'$%Hx$7H	 .  s#   0E E-EEEEc                 f    U R                  U5        U R                  U R                  U5      5        g r   )r  r`  r  ry  s     r4   rX  NavigationToolbar2.mouse_move  s)    E"55e<=r6   c                    U R                   [        R                  :X  aC  UR                  S:X  a  U R	                  U5        O!UR                  S:X  a  U R                  U5        U R                   [        R                  :X  aE  UR                  S:X  a  U R                  U5        g UR                  S:X  a  U R                  U5        g g g )Nr  r  )	r\  r6  r>  ro  	press_panrelease_panr?  
press_zoomrelease_zoomry  s     r4   rU  $NavigationToolbar2._zoom_pan_handler  s    99		!zz11u%55  '99

"zz11&55!!%( 6 #r6   c                  ^^ UU4S jnS n[        [        X0R                  R                  R	                  5       5      5      n[        U5      S:X  a  / $ U R                  5       c  U R                  5         [        5       n[        U5       H2  nUR                  UR                  5       / 5      R                  U5        M4     / n[        USS9 HZ  n	Xi    HM  nUR                  U5        UR                  UR                  R!                  U5      5        U" U5      (       d  MM    O   MZ    O   [        [        R#                  U5      5      nU$ )Nc                    > U R                  T5      =(       a+    U R                  5       =(       a    [        U ST 35      " 5       $ )Ncan_)in_axesrv  r  )r2  r  methods    r4   
_ax_filterDNavigationToolbar2._start_event_axes_interaction.<locals>._ax_filter  s;    JJu% 3OO%3B$vh02r6   c                 z    U R                  5       nUS:X  a  U R                  R                  5       (       + nU(       + $ )Nr  )get_forward_navigation_eventsr(  r*  )r2  fs     r4   _capture_eventsINavigationToolbar2._start_event_axes_interaction.<locals>._capture_events  s3    002AF{,,..5Lr6   r   T)reverse)rs   filterr:  r  r'  re   rQ  push_currentdictreversedrZ  
get_zorderr  rp  extend_twinned_axesget_siblingsfromkeys)
rJ   r  r  r  r  r.  grpsr2  axes_to_triggerzorders
    ``       r4   _start_event_axes_interaction0NavigationToolbar2._start_event_axes_interaction  s   		 F:{{'9'9'B'B'DEFt9>I??$ v4.BOOBMMOR077; ! T40Fl&&r*&&r'7'7'D'DR'HI"2&& #  ! 1& t}}_=>r6   c                 .   U R                   R                  R                  U 5      (       d  U R                  S5        gU R                  [
        R                  :X  a;  [
        R                  U l        U R                   R                  R                  U 5        O0[
        R                  U l        U R                   R                  U 5        U R                   R                  R                  5        H(  nUR                  U R                  R                  5        M*     g)zC
Toggle the pan/zoom tool.

Pan with left button, zoom with right.
zpan unavailableN)r:  r  	availabler`  r\  r6  r>  r;  releaser  r'  set_navigate_moder<  rJ   r8  r,  s      r4   r  NavigationToolbar2.pan  s     {{%%//55./99		!

DIKK""**40		DIKK""4(##,,.A		 8 89 /r6   _PanInfozbutton axes cidc                    UR                   [        R                  [        R                  4;  d  UR                  b  UR
                  c  gU R                  USS9nU(       d  gU H4  nUR                  UR                  UR
                  UR                   5        M6     U R                  R                  U R                  5        U R                  R                  SU R                  5      nU R                  UR                   X$S9U l        g)z1Callback for mouse button press in pan/zoom mode.Nr  r  rq  )rt  r.  r  )rt  ra  re  rg  rl   rm   r  	start_panr:  r  rY  r  drag_panr  rZ  )rJ   r  r.  r2  id_drags        r4   r  NavigationToolbar2.press_pan  s    LL!1!1;3D3D EE77?eggo11%1F BLL%''5<<8  	""4==1++))*?O<<d ' 9r6   c                     U R                   R                   HI  nUR                  U R                   R                  UR                  UR
                  UR                  5        MK     U R                  R                  5         g)z'Callback for dragging in pan/zoom mode.N)	rZ  r.  r  rt  ru  rl   rm   r:  r@  rJ   r  r2  s      r4   r  NavigationToolbar2.drag_pan  sR    ..%%B KK--uyy%''577K & 	r6   c                    U R                   c  gU R                  R                  U R                   R                  5        U R                  R	                  SU R
                  5      U l        U R                   R                   H  nUR                  5         M     U R                  R                  5         SU l         U R                  5         g)z3Callback for mouse button release in pan/zoom mode.Nrq  )rZ  r:  r  r  r  rX  rY  r.  end_panr@  r  r  s      r4   r  NavigationToolbar2.release_pan  s    >>!""4>>#5#56//!4??4..%%BJJL &r6   c                 0   U R                   R                  R                  U 5      (       d  U R                  S5        g  U R                  [
        R                  :X  a;  [
        R                  U l        U R                   R                  R                  U 5        O0[
        R                  U l        U R                   R                  U 5        U R                   R                  R                  5        H(  nUR                  U R                  R                  5        M*     g )Nzzoom unavailable)r:  r  r  r`  r\  r6  r?  r;  r  r  r'  r  r<  r  s      r4   r  NavigationToolbar2.zoom	  s    {{%%//55/0'99

"

DIKK""**40

DIKK""4(##,,.A		 8 89 /r6   	_ZoomInfoz direction start_xy axes cid cbarc                    UR                   [        R                  [        R                  4;  d  UR                  b  UR
                  c  gU R                  USS9nU(       d  gU R                  R                  SU R                  5      nUS   n[        US5      (       a  UR                  R                  nOSnU R                  UR                   S:X  a  SOS	UR                  UR
                  4X#US
9U l        g)z5Callback for mouse button press in zoom to rect mode.Nr  r  rq  r   	_colorbarr   inout)	directionstart_xyr.  r  cbar)rt  ra  re  rg  rl   rm   r  r:  r  	drag_zoomr  r  re  r  r[  )rJ   r  r.  id_zoom	parent_axr  s         r4   r  NavigationToolbar2.press_zoom  s    LL!1!1;3D3D EE77?eggo11%1G++))!4>>3 G	9k**&&22DD..#lla/dUgguww'dd ) Lr6   c                 H   U R                   R                  nU R                   R                  S   n[        R                  " X!R
                  UR                  //UR                  R                  UR                  R                  5      u  u  pEu  pgUR                  nU R                   R                  S:X  a  SnOU R                   R                  S:X  a  SnUS:X  a  UR                  R                  u  pWOUS:X  a  UR                  R                  u  pFU R                  XXVU5        g)z#Callback for dragging in zoom mode.r   
horizontalrl   verticalrm   N)r[  r  r.  r   cliprl   rm   r#  minr   ru  r  	intervaly	intervalxrg  )	rJ   r  r  r2  re  rf  x2y2ru  s	            r4   r  NavigationToolbar2.drag_zoom3  s    ??++__!!!$WW)*BGGKKF(2ii??</C__!!Z/C#:WW&&FBCZWW&&FBU3r6   c                   ^ U R                   c  gU R                  R                  U R                   R                  5        U R	                  5         U R                   R
                  u  p#UR                  nU R                   R                  S:X  a  SnOU R                   R                  S:X  a  Sn[        UR                  U-
  5      S:  a  US:w  d"  [        UR                  U-
  5      S:  a(  US:w  a"  U R                  R                  5         SU l         g[        U R                   R                  5       H  u  nm[        U4S jU R                   R                  SU  5       5      n[        U4S jU R                   R                  SU  5       5      nTR                  X#UR                  UR                  4U R                   R                   XFU5        M     U R                  R                  5         SU l         U R#                  5         g)	z7Callback for mouse button release in zoom to rect mode.Nr  rl   r  rm      c              3   d   >#    U  H%  nTR                  5       R                  TU5      v   M'     g 7fr   )get_shared_x_axesjoinedrO  prevr2  s     r4   rP  2NavigationToolbar2.release_zoom.<locals>.<genexpr>c  1      >$<D ,,.55b$??$<   -0c              3   d   >#    U  H%  nTR                  5       R                  TU5      v   M'     g 7fr   )get_shared_y_axesr  r  s     r4   rP  r  e  r  r  )r[  r:  r  r  rj  r  ru  r  absrl   rm   r@  	enumerater.  r  _set_view_from_bboxr  r  )	rJ   r  start_xstart_yru  r   twinxtwinyr2  s	           @r4   r  NavigationToolbar2.release_zoomF  s   ??" 	""4??#6#67 ??33ii ??</C__!!Z/C 7"#a'C3JUWWw&'!+s
KK!!#"DOt334EAr  >$(OO$8$8!$<> >E >$(OO$8$8!$<> >E""577EGG4))3u> 5 	r6   c                 j   U R                   R                  [        U R                  R                  R
                   Vs0 s HP  nXR                  5       UR                  S5      R                  5       UR                  5       R                  5       44_MR     sn5      5        U R                  5         gs  snf )z9Push the current view limits and position onto the stack.TN)
rQ  pushr	   r:  r  r.  	_get_viewget_positionrt   r]  r1  s     r4   r  NavigationToolbar2.push_currento  s    
  ;;--22	4 3R	 llnt,335(//134 4 3	45	6 	  "4s   AB0c                    U R                  5       nUc  g[        UR                  5       5      nU H@  u  nu  nu  pVUR                  U5        UR	                  US5        UR	                  US5        MB     U R
                  R                  5         g)zQ
Update the viewlim and position from the view and position stack for
each Axes.
Noriginalactive)rQ  rs   rY  	_set_view_set_positionr:  r@  )rJ   nav_inforY  r2  viewpos_orig
pos_actives          r4   rm  NavigationToolbar2._update_viewz  s    
 ??$ X^^%&27.B.-LLXz2Z2	 38
 	r6   c                   ^ ^^ [        T S5      (       a9  T R                  R                  R                  R                  R                  5         g SSKJn  [        R                  " SS05         [        T R                  5      R                  U" SS9S5      mS S S 5        TR                  S	5        TR                  R                  nUR                  S
S9  [        R                  " T R                  R                  U5      T l        T R                  R!                  SU4S j5      mUU 4S jnUR                  R!                  SU5        TR                  5         T R                  $ ! , (       d  f       N= f)Nsubplot_toolr   r  r  r  )   r   )figsizezSubplot configuration toolg?)topr  c                 $   > TR                  5       $ r   )r)  )er  s    r4   r:  7NavigationToolbar2.configure_subplots.<locals>.<lambda>  s    W__%6r6   c                 @   > TR                   R                  T5        T?g r   )r:  r  r   )r  r  rJ   s    r4   on_tool_fig_close@NavigationToolbar2.configure_subplots.<locals>.on_tool_fig_close  s    KK&&s+!r6   )r  r   r  r:  r  r  r  r  r  
rc_contextr&  r  r  subplots_adjustr   SubplotToolr  )rJ   r8  r  tool_figr	  r  r  s   `    @@r4   rL  %NavigationToolbar2.configure_subplots  s   4(($$++3388:,^^Y/04;;'33F64JBOG 1  !=>>>((  S )#//0B0BHMkk%%68	" 	##M3DE    10s   ,*E##
E1c                     [         e)a.  
Save the current figure.

Backend implementations may choose to return
the absolute path of the saved file, if any, as
a string.

If no file is created then `None` is returned.

If the backend does not implement this functionality
then `NavigationToolbar2.UNKNOWN_SAVED_STATUS` is returned.

Returns
-------
str or `NavigationToolbar2.UNKNOWN_SAVED_STATUS` or `None`
    The filepath of the saved figure.
    Returns `None` if figure is not saved.
    Returns `NavigationToolbar2.UNKNOWN_SAVED_STATUS` when
    the backend does not provide the information.
rY   rn  s     r4   r  NavigationToolbar2.save_figure  s
    * "!r6   c                 X    U R                   R                  5         U R                  5         g)zReset the Axes stack.N)rQ  clearr]  r   s    r4   r  NavigationToolbar2.update  s      "r6   c                     g)z*Enable or disable the back/forward button.NrN   r   s    r4   r]  &NavigationToolbar2.set_history_buttons  rS   r6   )r|  rY  rV  rW  rT  rQ  rZ  r[  r:  r\  r   N))rB  rC  rD  rE  rF  	toolitemsobjectUNKNOWN_SAVED_STATUSrD   r`  rg  rj  r  r  rG  r  r   r  staticmethodr  rX  rU  r  r  r   r  r  r  r  r  r  r  r  r  r  rm  rL  r  r  r]  rG  rN   r6   r4   rA  rA  
  s    LI "8#&=%


6"  *  *>
)3j:$ *&78H9( : ;(JKIL44&'R	# $!.".#
9r6   rA  c                   X    \ rS rSrSrSr S rS rSS jrS r	S r
S	 rS
 rS rS rSrg)ToolContainerBasei  z
Base class for all tool containers, e.g. toolbars.

Attributes
----------
toolmanager : `.ToolManager`
    The tools with which this `ToolContainer` wants to communicate.
z.pngc                 l   ^  UT l         UR                  SU 4S j5        UR                  SU 4S j5        g )Ntool_message_eventc                 :   > TR                  U R                  5      $ r   )r`  r#  r  rJ   s    r4   r:  ,ToolContainerBase.__init__.<locals>.<lambda>  s    $**5==9r6   tool_removed_eventc                 N   > TR                  U R                  R                  5      $ r   )remove_toolitemtoolro  r   s    r4   r:  r!    s    $..uzz?r6   )r  toolmanager_connect)rJ   r  s   ` r4   rD   ToolContainerBase.__init__  s6    &'' 9	; 	'' ?	Ar6   c                 x    U R                  UR                  R                  UR                  R                  5        g)zK
Capture the 'tool_trigger_[name]'

This only gets used for toggled tools.
N)toggle_toolitemr%  ro  toggledry  s     r4   _tool_toggled_cbk#ToolContainerBase._tool_toggled_cbk  s&     	UZZ__ejj.@.@Ar6   c                    U R                   R                  U5      nU R                  U5      n[        USS5      SLnU R	                  UR
                  X#XAR                  U5        U(       ab  U R                   R                  SUR
                  -  U R                  5        UR                  (       a  U R                  UR
                  S5        ggg)a  
Add a tool to this container.

Parameters
----------
tool : tool_like
    The tool to add, see `.ToolManager.get_tool`.
group : str
    The name of the group to add this tool to.
position : int, default: -1
    The position within the group to place this tool.
r*  Nztool_trigger_%sT)r  get_tool_get_image_filenamer  add_toolitemro  r3   r&  r+  r*  r)  )rJ   r%  grouppositionr  toggles         r4   add_toolToolContainerBase.add_tool  s     ((.((.y$/t;$))U!1!16	;001BTYY1N151G1GI ||$$TYY5 	 r6   c                    UR                   (       d  g[        R                  R                  UR                   5      (       a  UR                   nOS[	        US0 5      ;   a  [        S5      e[        U5      R                   H+  nS[        U5      ;   d  M   [        R                  " U5      n  O   [        S5      e[        [        R                  " U5      R                   UR                   -  5      nX"U R"                  -   4 HH  n[        R                  R%                  U5      (       d  M)  [        R                  R'                  U5      s  $    UR                   UR                   U R"                  -   [(        R*                  " SUR                   5      [(        R*                  " SUR                   U R"                  -   5      4 Hl  n[        R                  R%                  U5      (       d  M)  [,        R.                  " SS	UR                   < S
3S9  [        R                  R'                  U5      s  $    g! [        [        4 a    [        S5      Sef = f)zResolve a tool icon's filename.Nr  r  zDIf 'tool.image' is an instance variable, it must be an absolute pathz:Failed to locate source file where 'tool.image' is definedz1Failed to find parent class defining 'tool.image'imagesr  zLoading icon z from the current directory or from Matplotlib's image directory.  This behavior is deprecated since %(since)s and will be removed in %(removal)s; Tool.image should be set to a path relative to the Tool's source file, or to an absolute path.r"  )r  r  r\   isabsr  r  r&  __mro__varsrq  getfileOSError	TypeErrorr9   pathlibr   r  _icon_extensionisfileabspathr   _get_data_pathr
   r$  )rJ   r%  r  r  srcfnames         r4   r/  %ToolContainerBase._get_image_filename  s   zz77==$$zzH'$
B77  "? @ @Dz))d3i'T%ooc2	 * !!TUU7<<,33djj@AH!d.B.B#BCHww~~h''wwx00 D JJJJ---  4::6  4::8L8L+LM	
E ww~~e$$$$]4::. A4 $45 wwu--
 $Y/ T( *I JOSTTs   H..Ic                 6    U R                   R                  XS9  g)zt
Trigger the tool.

Parameters
----------
name : str
    Name (id) of the tool triggered from within the container.
)senderN)r  trigger_toolrJ   ro  s     r4   rH  ToolContainerBase.trigger_tool%  s     	%%d%8r6   c                     [         e)a+  
A hook to add a toolitem to the container.

This hook must be implemented in each backend and contains the
backend-specific code to add an element to the toolbar.

.. warning::
    This is part of the backend implementation and should
    not be called by end-users.  They should instead call
    `.ToolContainerBase.add_tool`.

The callback associated with the button click event
must be *exactly* ``self.trigger_tool(name)``.

Parameters
----------
name : str
    Name of the tool to add, this gets used as the tool's ID and as the
    default label of the buttons.
group : str
    Name of the group that this tool belongs to.
position : int
    Position of the tool within its group, if -1 it goes at the end.
image : str
    Filename of the image for the button or `None`.
description : str
    Description of the tool, used for the tooltips.
toggle : bool
    * `True` : The button is a toggle (change the pressed/unpressed
      state between consecutive clicks).
    * `False` : The button is a normal button (returns to unpressed
      state after release).
rY   )rJ   ro  r1  r2  r  r3   r3  s          r4   r0  ToolContainerBase.add_toolitem0  s    D "!r6   c                     [         e)a  
A hook to toggle a toolitem without firing an event.

This hook must be implemented in each backend and contains the
backend-specific code to silently toggle a toolbar element.

.. warning::
    This is part of the backend implementation and should
    not be called by end-users.  They should instead call
    `.ToolManager.trigger_tool` or `.ToolContainerBase.trigger_tool`
    (which are equivalent).

Parameters
----------
name : str
    Id of the tool to toggle.
toggled : bool
    Whether to set this tool as toggled or not.
rY   )rJ   ro  r*  s      r4   r)  !ToolContainerBase.toggle_toolitemT  s
    ( "!r6   c                     [         e)a{  
A hook to remove a toolitem from the container.

This hook must be implemented in each backend and contains the
backend-specific code to remove an element from the toolbar; it is
called when `.ToolManager` emits a ``tool_removed_event``.

Because some tools are present only on the `.ToolManager` but not on
the `ToolContainer`, this method must be a no-op when called on a tool
absent from the container.

.. warning::
    This is part of the backend implementation and should
    not be called by end-users.  They should instead call
    `.ToolManager.remove_tool`.

Parameters
----------
name : str
    Name of the tool to remove.
rY   rI  s     r4   r$  !ToolContainerBase.remove_toolitemj  s
    , "!r6   c                     [         e)zT
Display a message on the toolbar.

Parameters
----------
s : str
    Message text.
rY   rU   s     r4   r`  ToolContainerBase.set_message  s
     "!r6   )r  N)r  )rB  rC  rD  rE  rF  r?  rD   r+  r4  r/  rH  r0  r)  r$  r`  rG  rN   r6   r4   r  r    sD     OAB62%.N	9""H","0	"r6   r  c                   |    \ rS rSrSrSr\rSr\	S 5       r
\	S 5       r\	S 5       r\	SS.S j5       r\S	 5       rS
rg)_Backendi  unknownNc                 d    SSK Jn  UR                  SU5      nU" U0 UD6nU R                  X5      $ )z%Create a new figure manager instance.r   r  FigureClass)r  r  r&  new_figure_manager_given_figure)r  r  r8  r9  r  fig_clsr  s          r4   new_figure_manager_Backend.new_figure_manager  s7     	-**]F3t&v&223<<r6   c                 8    U R                   R                  X!5      $ )z:Create a new figure manager instance for the given figure.)r<   r  )r  r  r  s      r4   rX  (_Backend.new_figure_manager_given_figure  s     ++F88r6   c                 P   U R                   R                  nUR                  [        R                  :g  =(       d    UR                  [        R                  :g  nU(       aH  [        5       (       a8  [        R                  " 5       nU(       a  UR                  R                  5         g g g g r   )
r<   r  r  r  r  r   r   
get_activer:  r@  )r  r  backend_is_interactiver  s       r4   draw_if_interactive_Backend.draw_if_interactive  s    ((66 ))->-N-NN J((,=,I,II 	 "n&6&6nn&G((*  '7!r6   r  c                   [         R                  " 5       nU(       d  gU H  n UR                  5         M     U R                  c  gUcS  [        [        R                  R                  S5      SS5      n[        US5      nU(       + =(       a    [        5       (       + nU(       a  U R                  5         gg! [         a*  n[        R
                  " [        U5      5         SnAM  SnAff = f)z
Show all figures.

`show` blocks by calling `mainloop` if *block* is ``True``, or if it is
``None`` and we are not in `interactive` mode and if IPython's
``%matplotlib`` integration has not been activated.
Nr  r  r  )r   r  r  r  r
   r  r9   mainloopr  r	  r
  r  r  r   r  s          r4   r  _Backend.show  s     ++-G-  
 <<= "#++//2E"FPTUK#K=M%%>n.>*>ELLN  # -""3s8,,-s   B55
C)?C$$C)c           	         ^  S H5  n[        [        R                  T R                     U[	        T U5      5        M7      " U 4S jS[
        5      n[        [        R                  T R                     SU5        T $ )N)backend_versionr<   FigureManagerrZ  rX  ra  r  c                   "   > \ rS rSrU 4S jrSrg)_Backend.export.<locals>.Showi  c                 $   > TR                  5       $ r   )rd  )rJ   r  s    r4   rd  &_Backend.export.<locals>.Show.mainloop  s    ||~%r6   rN   N)rB  rC  rD  rE  rd  rG  r  s   r4   Showrj    s    & &r6   rm  )setattrr	  r
  rC  r  ShowBase)r  ro  rm  s   `  r4   export_Backend.export  s]    
D CKK/wsD7IJ
	&8 	& 	CNN+VT:
r6   rN   )rB  rC  rD  rE  rg  r<   r  rh  rd  r  rZ  rX  ra  r  r  rp  rG  rN   r6   r4   rT  rT    s      O L &M
 H
 = = 9 9 	+ 	+   <  r6   rT  c                   "    \ rS rSrSrSS jrSrg)ro  i  zq
Simple base class to generate a ``show()`` function in backends.

Subclass must override ``mainloop()`` method.
Nc                      U R                  US9$ )Nr  )r  )rJ   r  s     r4   __call__ShowBase.__call__  s    yyuy%%r6   rN   r   )rB  rC  rD  rE  rF  rt  rG  rN   r6   r4   ro  ro    s    &r6   ro  r   rw  )_rF  collectionsr   
contextlibr   r   r   enumr   r   rt  r:   rq  r  r   loggingr  r>  r  r  r	  r  r  r	   numpyr   
matplotlibr  r
   r   r
  r   r   r   r   r   r   r   r   r   matplotlib._pylab_helpersr   matplotlib.backend_managersr   matplotlib.cbookr   matplotlib.layout_enginer   matplotlib.pathr   matplotlib.texmanagerr   matplotlib.transformsr   matplotlib._enumsr   r   	getLoggerrB  rz  r0   r/   r5   r>   r@   r#  r  r8  rB  rG  rK  rN  ra  rk  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  cursorsr9   r6  rA  r  rT  ro  rN   r6   r4   <module>r     sB  6 # = =     	   	    
   %  @ @ @ @ * 3 ( <   , * 1 "$-.%&
%&%& " ,,-,,,
*,-,-,-- $-&`+ `+FH= H=V
Z Zz 8! !6<% <(7 77E 7t' i) i)X.% .%b"} "L!"AJ<@$? 6. 6.rJ JZJ8Z&	i 	
L L^ --
=C 
=r9 r9jH" H"Ve eP&x &r6   