rL iM ddlmZmZddlmZddlZddlZddlZddlm Z ddl m Z ddl Z ddl Z ddlZddlZddlmZmZmZmZddlmZddlmZddlmZmZmZddl m!Z"ddl#m$Z%ddl&m'Z'ddl(m)Z)ddl*m+Z,ddl-m.Z/ddl0m1Z2dd l3m4Z4m5Z5ddl6m7Z8ddl9m:Z;ddlddl?m@ZAddlBmCZDejeFZGGd d ZHGd d ZIdddZJGddZKejddgiGddejZNdZOy))IterableSequence) ExitStackN)Real) attrgetter)_apicbook _docstring offsetbox) _OrderedSet _check_1dindex_of) SubplotSpec)cyclervalidate_axisbelowc"eZdZdZdddZdZy)_axis_method_wrappera6 Helper to generate Axes methods wrapping Axis methods. After :: get_foo = _axis_method_wrapper("xaxis", "get_bar") (in the body of a class) ``get_foo`` is a method that forwards it arguments to the ``get_bar`` method of the ``xaxis`` attribute, and gets its signature and docstring from ``Axis.get_bar``. The docstring of ``get_foo`` is built by replacing "this Axis" by "the {attr_name}" (i.e., "the xaxis", "the yaxis") in the wrapped method's dedented docstring; additional replacements can be given in *doc_sub*. Ndoc_subcZ||_||_tjt t j |}g|_|r`dd|ji|xsi}|jD]6\}}||vr|jj||j||}8||_ y)Nz this Axiszthe ) attr_name method_nameinspectgetdocgetattrmaxisAxis _missing_subsitemsappendreplace__doc__)selfrrrdockvs [/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/axes/_base.py__init__z_axis_method_wrapper.__init__4s"&nnWUZZ=> "d4>>*:$;O 2OG  (1C<&&--a0kk!Q' ( c .t|jd|jfd}|j|_||_|j d||_|j |_tjttj|j|_ |jrWtdj|j |jdj!t#t$|jt'|||y)N.c ||i|SN)r#argskwargs get_methods r'wrapperz2_axis_method_wrapper.__set_name__..wrapperIs#:d#T4V4 4r)zWThe definition of {} expected that the docstring of Axis.{} contains {!r} as substrings, )rrr __module____name__ __qualname__r"r signaturerrr __signature__r ValueErrorformatjoinmapreprsetattr)r#ownernamer2r1s @r' __set_name__z!_axis_method_wrapper.__set_name__Cs 4>>"2!D4D4D3E FG  5#--"'"4"4!5Qtf=,,!( 1 1 EJJ 0 0 1!3   ..4f(($*:*:IIc$(:(:;</>? ? tW%r))r5r4r6r"r(rAr.r)r'rr#s ;? &r)rceZdZdZdZdZy)_TransformedBoundsLocatorz Axes locator for `.Axes.inset_axes` and similarly positioned Axes. The locator is a callable object used in `.Axes.set_aspect` to compute the Axes location depending on the renderer. c ||_||_y)z *bounds* (a ``[l, b, w, h]`` rectangle) and *transform* together specify the position of the inset Axes. N)_bounds _transform)r#bounds transforms r'r(z"_TransformedBoundsLocator.__init__hs  #r)ctjtjj|j|j |j djz S)NFroot) mtransformsTransformedBboxBbox from_boundsrErF get_figuretransSubfigure)r#axrenderers r'__call__z"_TransformedBoundsLocator.__call__psN**    ( ($,, 7 OObmmm7FF FH Hr)N)r5r4r6r"r(rTr.r)r'rCrC`s$Hr)rCFambiguous_fmt_datakeycd}d}d}|dvr tj|}|||fS|rdnd}d}|t|kr||}|||dztj vr,|t|j |d|||dz}|dz }n,|tj vr%|t|j |d|}|dz }n|tjvr%|t|j |d |}|dz }n|tjvr%|t|j |d |}|dz }n|d k(r`tjd ||d}|st|j |d tj|d}|t|dz }nt|j |d||t|kr||tjd}|d}|d}|||fS#t$rYwxYw)av Convert a MATLAB style color/line style format string to a (*linestyle*, *marker*, *color*) tuple. Example format strings include: * 'ko': black circles * '.b': blue dots * 'r--': red dashed lines * 'C2--': the third color in the color cycle, dashed lines The format is absolute in the sense that if a linestyle or marker is not defined in *fmt*, there is no line or marker. This is expressed by returning 'None' for the respective quantity. See Also -------- matplotlib.Line2D.lineStyles, matplotlib.colors.cnames All possible styles and color format strings. N)01z9{!r} is neither a data key nor a valid format string ({})z&{!r} is not a valid format string ({})rztwo linestyle symbolsztwo marker symbolsztwo color symbolsCzC\d+z 'C' must be followed by a numberzunrecognized character zlines.linestyleNone) mcolorsto_rgbar9lenmlines lineStylesr: lineMarkersget_named_colors_mappingrematchmplrcParams) fmtrV linestylemarkercolorerrfmticcn_colors r'_process_plot_formatrqys?,I F E  * OOC(Efe+ + 'J6  A c#h, F q1:** *$ s4K!LMMAac I FA &## #$ s4K!LMMI FA &$$ $! s4H!IJJF FA '224 4  s4G!HIIE FA #XxxQR1H s4V!WXXOOHQK0E Xa[! !AV]]32I!0OPQ Q; c#h,>V^LL!23   ~ fe ##]   sG&& G32G3cleZdZdZddZdZddddZdZefd Z d Z d Z d Z d Z ddddZy)_process_plot_var_argsa Process variable length arguments to `~.Axes.plot`, to support :: plot(t, s) plot(t1, s1, t2, s2) plot(t1, s1, 'ko', t2, s2) plot(t1, s1, 'ko', t2, s2, 'r--', t3, e3) an arbitrary number of *x*, *y*, *fmt* are allowed cftjgd|||_|jdy)NLine2DPolygon coordinatesoutput)r check_in_listrzset_prop_cycle)r#rzs r'r(z_process_plot_var_args.__init__s( ?O  D!r)cN|tjd}d|_g||_y)Nzaxes.prop_cycler)rgrh_idx _cycler_items)r#rs r'r|z%_process_plot_var_args.set_prop_cycles) >\\"34F &vYr)NF)data return_kwargsc/K|j|dD];}||vstjtjdj ||sy|#|Dcgc]}t j|}}n|Dcgc]}tj||} }t|dk(rd} njt|dk(r@ t|d| d|dur$tjd|ddtd} nd} nt|dk(rd} n td |jd tj | | || |d <| }|duxrt|dk(} t|d k\r/t j"|jd s td |rO|dd|dd}} |r!t%|dt&r| |dfz } |dd}|j)|| || | Ed{|rNyycc}wcc}w#t$rd} YwxYw7$w)N)r0xyr[rrZzSecond argument a" is ambiguous: could be a format string but is in 'data'; using as data. If it was intended as data, set the format string to an empty string to suppress this warning. If it was intended as a format string, explicitly pass the x-values as well. Alternatively, rename the entry in 'data'.zwUsing arbitrary long args with data is not supported due to ambiguity of arguments; use multiple plotting calls insteadlabelz]plot() with multiple groups of data (i.e., pairs of x and y) does not support multiple labels)rVr)_process_unit_infor kwarg_errorrstackfunctionr sanitize_sequencerg _replacerr`rq warn_externalRuntimeWarningr9get_label_from_argis_scalar_or_string isinstancestr _plot_args) r#axesrrr/r0pos_onlyaargreplacedlabel_namer_idxrVthiss r'rTz_process_plot_var_args.__call__sR v. NH6!&&w}}q'9'B'BHMM N  <8<=1E++A.=D=<@AS dC0AHA4yA~"#Ta,(a1 {$q'1**.tAwk:IJ+,+,*+Ta"# zz'"*"%"5"5_-tO/D#FwD $D 0 CSY!^ t9>%";"; 7##%&' 'bq48$D 47C0Q ABxdF:O+'   m>A"(&'O(V sYH ?H G0:H G5!H G:DH &H 'H . H : HH HH c|j|j}d|vr/|jdzt|jz|_|dSy)z#Return the next color in the cycle.rlr[r%)rr~r`)r#entrys r'get_next_colorz%_process_plot_var_args.get_next_color.sJ""499- e Q#d.@.@*AADI> !r)c|j|j}tfdh||z DrS|jdzt|jz|_|j Dcic] \}}||vs ||c}}SiScc}}w)a8 If some keys in the property cycle (excluding those in the set *ignore*) are absent or set to None in the dict *kw*, return a copy of the next entry in the property cycle, excluding keys in *ignore*. Otherwise, don't advance the property cycle, and return an empty dict. c3FK|]}j|dduywr-r).0r%kws r' z6_process_plot_var_args._getdefaults..?s E1rvva$&Es!r[)rr~anyr`r)r#rignoredefaultsr%r&s ` r' _getdefaultsz#_process_plot_var_args._getdefaults7s%%dii0 E ( f0DE EQ#d.@.@*AADI%-^^%5ITQ&AqDI IIJs 1 B >B cH|D]}|j|d||||<y)zx Add to the dict *kw* the entries in the dict *default* that are absent or set to None in *kw*. Nr)r#rrr%s r' _setdefaultsz#_process_plot_var_args._setdefaultsFs0  $Avva&  1 $r)ci||}|j|j||tj||fi|}||fSr-)rrrarv)r#rxyrr0segs r' _make_linez!_process_plot_var_args._make_lineOsJ  f  $++B/4mmAq'B'Bwr)c\i||}|j|j||||f|fSr-)rr)r#rrrrr0s r'_make_coordinatesz(_process_plot_var_args._make_coordinatesUs:  f  $++B/41vrzr)cJ|j|}|j|}|j}|j}hd|jDchc] \}}| | c}}z}|j ||} |j | ||j dd} | jdd|j | |tjtj||f| |j dd|d} | jdi|| |fScc}}w)N>rk markersizemarkeredgecolormarkeredgewidthmarkerfacecolorrlfillTclosed) facecolorrrr.) convert_xunitsconvert_yunitscopyrrrrpopmpatchesrwnp column_stackset) r#rrrrr0r%r&ignores default_dictrrs r' _make_polygonz$_process_plot_var_args._make_polygonZs    "    " WWY:%+LLNDDAqamaDE((W5  ,+FF7D)  $' ,/r1v6)2$*JJvt$<&(l4 &F{;Es  D$D)rrVc t|dkDr*t|dtr|^}}t||\}} } n!t|dk(r t d|}d\}} } t d|Dr t dit d || | fD]M\} } |  jd k7r-| vr)| d k7r$tj| d | d|d| d| d | | <Ot|dk(rt|dt|dnt|d\jjjjjjjdjdk7r%t djdjj dkDsj dkDr%t djdjj dk(rd d t"j$fj dk(rd d t"j$f|j&dk(r |j(np|j&dk(r"j+ddd<|j,n?|j&dk(r |j.n#tj0gd|j&jdjdcdkDrdkDrk7rt ddd dk(sdk(rgSj+d!} t3}t5j6| r| g|z}n[t| |k(r| }nJ|dk(r*d"t| d#}tj8d$|%| g}nt d&t| d'|d(fd)t;|D}|r t=|S|Dcgc]}|d c}Scc}w)*a Process the arguments of ``plot([x], y, [fmt], **kwargs)`` calls. This processes a single set of ([x], y, [fmt]) parameters; i.e. for ``plot(x, y, x2, y2)`` it will be called twice. Once for (x, y) and once for (x2, y2). x and y may be 2D and thus can still represent multiple datasets. For multiple datasets, if the keyword argument *label* is a list, this will unpack the list and assign the individual labels to the datasets. Parameters ---------- tup : tuple A tuple of the positional parameters. This can be one of - (y,) - (x, y) - (y, fmt) - (x, y, fmt) kwargs : dict The keyword arguments passed to ``plot()``. return_kwargs : bool Whether to also return the effective keyword arguments after label unpacking as well. ambiguous_fmt_datakey : bool Whether the format string in *tup* could also have been a misspelled data key. Returns ------- result If *return_kwargs* is false, a list of Artists representing the dataset(s). If *return_kwargs* is true, a list of (Artist, effective_kwargs) representing the dataset(s). See *return_kwargs*. The Artist is either `.Line2D` (if called from ``plot()``) or `.Polygon` otherwise. r[rUrz!third arg must be a format string)NNNc3$K|]}|du ywr-r.)rr&s r'rz4_process_plot_var_args._plot_args..s&QqDy&sz(x, y, and format string must not be None)rjrkrlNnoner]z is redundantly defined by the 'z'' keyword argument and the fmt string "z" (-> =z-). The keyword argument will take precedence.rZrz8x and y must have same first dimension, but have shapes z and z3x and y can be no greater than 2D, but have shapes rvrwrTrxruryzx has z columns but y has z columnsrzPassing label as a length z sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11. To keep the current behavior, cast the sequence to string before passing.z3.9)messagezJlabel must be scalar or have the same length as the input data, but found z for z datasets.c 3pK|]-\}} dd|zf dd|zfid|i/yw)Nrr.) rjrrrr0 make_artistncxncyrrs r'rz4_process_plot_var_args._plot_args..sQ5adAaSjM1QCZ="88%8:5s36)r`rrrqr9rziplowerrrr rxaxis update_unitsyaxisshapendimrnewaxisrzrrrrr{maxr rwarn_deprecated enumeratelist)r#rtupr0rrVrrirjrkrl prop_namevalr n_datasetslabelsmsgresultlrrrrrrs ` ` @@@@@@r'rz!_process_plot_var_args._plot_argssZ s8a $NIsIIK6)%/6M&&$+&%;'5yk3':9:; !$9 - $0 r7a<"Q% A"Q% ABrF#DAq :: ! JJ # #A & :: ! JJ # #A & 771: # ,,-GG9E!''DE E 66A:! ''(wwiuQWWI?@ @ 66Q;!RZZ- A 66Q;!RZZ- A ;;( "//K [[I %!::h5BxL,,K [[M )00K   CDKK X771:qwwqzS 7sQw3#:vcU*=cU(KL L !8saxI 7#c]  $ $U +Wz)F Z: %F 1_/E |ed:Z?ed;Z@ed<ZAd=ZBd>ZCd?ZDd@ZEdAZFddBZGdCZHddDZIdEZJddFZKdGZLddHZMdIZNddJZOdd dKdLZPdMZQdNZRdOZSdPZTdQZUeVddRZWeVddSZXeVddRZYeVddSZZdTZ[dUZ\dVZ]dWZ^dXZ_ddYZ`dZZad[Zbd\Zcd]Zdd^Zed_Zfd`ZgdaZhdbZiddcZjdddZkddeZldd dfdgZmdhZneVddiZoeVddiZpeVddjZqeVddjZrdkZsdlZtedmZueujdnZudoZwdpZxdqZydrZzd d d dsdtZ{duZ|dvZ}ddwZ~ddxZdyZejdzZd{Zd|Zd}Zd~ZdZdZejddZd&d d d d d ddZddZddZdZdZdZdd ddZdZeVddZdZddZdZdZdd dd d ddZeVddZeVddZeVddZeVddddiZeVddZeVddZeVddZeVddddiZdZdd ddZdZeVddZdZddZdZdd dd d ddZeVddZeVddZeVddZeVddddiZeVddZeVddZeVddZeVddddiZeVddZeVddZdZdZdZdZdZdZdZdZdZdZdZdZdZ ddZ ddZdZdZdZdZdZdZdZdZdd d ddd„ZdÄZdĄZdńZdƄZdDŽZddȄZdɄZddʜd˄Zddʜd̄Zd̈́Zd΄Z׈xZScc}}}w) _AxesBase rectilinearrrFdataLimspinesrrc \|jDcic]}|t||dc}Scc}w)z7A mapping of axis names, e.g. 'x', to `Axis` instances.axis) _axis_namesr)r#r@s r' _axis_mapz_AxesBase._axis_map]s<!,,.gdtfDM22. ..s)ctdjt|j|jjS)Nz({0}({1[0]:g},{1[1]:g};{1[2]:g}x{1[3]:g}))r:typer5 _positionrGr#s r'__str__z_AxesBase.__str__cs.9@@ J  !6!68 8r)NTauto) rframeonsharexshareyrxscaleyscale box_aspectforward_navigation_eventsc t|d| vrL| r td| jd} t j t jtf| | f} d}t| dk(r6t| dt jr| dj|_ nt| dk(r=tj| dr%t jj| d|_ n@t jj!x|_ |_t%j&|| }|jj(dks|jj*dkr t-d|jj|_||_d|_d |_d |_t6j9|j:d |_| |_||_ ||_!|jE||jG||r|jI|nd|_%|jM| d|_'g|_(g|_)tTjVjY|j[|_.|j_|t`jbd }||_2||_3|jit`jbd d|_5|jmd|_7d|_8|jsd|jud|r|jw||r|jy||j{| |j|jD]0\}}|jjd|j|2t`jb}|j|dxr|d|dxr|d|dxr|d|dxr|d|dxr|d|dxr|d|dxr|d|dxr|dd |j|dxr|d|dxr|d|dxr|d|dxr|d|dxr|d |dxr|d!|dxr|d |dxr|d!d" y)#a* Build an Axes in a figure. Parameters ---------- fig : `~matplotlib.figure.Figure` The Axes is built in the `.Figure` *fig*. *args ``*args`` can be a single ``(left, bottom, width, height)`` rectangle or a single `.Bbox`. This specifies the rectangle (in figure coordinates) where the Axes is positioned. ``*args`` can also consist of three numbers or a single three-digit number; in the latter case, the digits are considered as independent numbers. The numbers are interpreted as ``(nrows, ncols, index)``: ``(nrows, ncols)`` specifies the size of an array of subplots, and ``index`` is the 1-based index of the subplot being created. Finally, ``*args`` can also directly be a `.SubplotSpec` instance. sharex, sharey : `~matplotlib.axes.Axes`, optional The x- or y-`~.matplotlib.axis` is shared with the x- or y-axis in the input `~.axes.Axes`. Note that it is not possible to unshare axes. frameon : bool, default: True Whether the Axes frame is visible. box_aspect : float, optional Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See `~.axes.Axes.set_box_aspect` for details. forward_navigation_events : bool or "auto", default: "auto" Control whether pan/zoom events are passed through to Axes below this one. "auto" is *True* for axes with an invisible patch and *False* otherwise. **kwargs Other optional keyword arguments: %(Axes:kwdoc)s Returns ------- `~.axes.Axes` The new `~.axes.Axes` object. rectz8'rect' cannot be used together with positional arguments)rNr[rz/Width and height specified must be non-negativerboxr\Fzaxes.facecolorzaxes.axisbelowTunitsz xtick.topzxtick.minor.topz xtick.bottomzxtick.minor.bottomzxtick.labeltopzxtick.labelbottomz ytick.leftzytick.minor.leftz ytick.rightzytick.minor.rightzytick.labelleftzytick.labelrightminor) topbottomlabeltop labelbottomleftright labelleft labelrightwhichzxtick.major.topzxtick.major.bottomzytick.major.leftzytick.major.rightmajor)Dsuperr( TypeErrorrrcheck_isinstancerLrNrr`rfrozenrriterablerOunit_originalPositionr_from_subplot_argswidthheightr9r_aspect _adjustable_anchordictfromkeysr_stale_viewlims_forward_navigation_events_sharex_sharey set_label set_figureset_subplotspec _subplotspecset_box_aspect _axes_locator _children _colorbarsmspinesSpines from_dict_gen_axes_spinesr _init_axisrgrh _facecolor_frameon set_axisbelow_rasterization_zorderclear fmt_xdata fmt_ydata set_navigateset_navigate_mode set_xscale set_yscale_internal_updaterr callbacks_connect_picklable_unit_change_handler tick_params)r#figrrrrrrrrrr/r0r subplotspecr@rrh __class__s r'r(z_AxesBase.__init__gs||  V NPP::f%D  ! !;#3#3X">T J7D t9>ja+2B2BC!!W^^-DN Y!^ DG 4(--9947CDN6A6F6F6K6K6M MDNT3%88dCK >>  ! #t~~'<') get_labelhasattrrUrrrget_textr?r5r;)r#fieldstitlesr%titler@rs r'__repr__z_AxesBase.__repr__2s  >>   0345 5F 4 %F0 &1- %F1I &VF8,--....0 EJD$zzdjj113dV6$***=*=*?)BCDD E4>>**+2.61BBSHHr)c|jS)z?Return the `.SubplotSpec` associated with the subplot, or None.)r#rs r'get_subplotspecz_AxesBase.get_subplotspecCs   r)cr||_|j|j|jdy)z4Set the `.SubplotSpec`. associated with the subplot.FrJN)r# _set_position get_positionrP)r#r>s r'r"z_AxesBase.set_subplotspecGs.' ;33DOOO4OPQr)cR|jr|jjSdS)z.{s&L((.LsFscaler.)rrrIrLvaluesrautoscale_viewr)r#r@ need_scalerRr{s ` r'_unstale_viewLimz_AxesBase._unstale_viewLimws  ((* #L $ 1 1$ 7 D DT JLL L* * z  " #" 5++D1>>tD5B/4B&&t,5 5 D   K6@6F6F6H#J'2tU&+4&>5#8#J K $ *#Js 8C>Cc:|j|jS)z/The view limits as `.Bbox` in data coordinates.)rrsrs r'viewLimz_AxesBase.viewLims }}r)ctji|jDcic]}||gc}d|ji|}|D]}d|j|<|||_yycc}w)a Mark a single axis, or all of them, as stale wrt. autoscaling. No computation is performed until the next autoscaling; thus, separate calls to control individual axises incur negligible performance cost. Parameters ---------- axis : str, default: "all" Either an element of ``self._axis_names``, or "all". tight : bool or None, default: None allrTN)r check_getitemrr_tight)r#rtightr% axis_namesr@s r'_request_autoscale_viewz!_AxesBase._request_autoscale_views{'' K 0 011A31 K5$:J:J K  .D)-D  & .  DK  2s A# c:tj|j|_tjtj |_tjtj|j|j |_ |j |j|jzz|_ tj|j|j|_ tj|j|j|_y)a Set the *_xaxis_transform*, *_yaxis_transform*, *transScale*, *transData*, *transLimits* and *transAxes* transformations. .. note:: This method is primarily used by rectilinear projections of the `~matplotlib.axes.Axes` class, and is meant to be overridden by new kinds of projection Axes that need different transformations and limits. (See `~matplotlib.projections.polar.PolarAxes` for an example.) N)rLBboxTransformTork transAxesrtrurvBboxTransformFromrMrs transLimits transDatablended_transform_factory_xaxis_transform_yaxis_transformrs r'rwz!_AxesBase._set_lim_and_transformss%44TYY? &66  ) ) +- '88  ' ' t GI D,<,>((* *r)bothcL|j|||jdy)a! Set the Axes position. Axes have two position attributes. The 'original' position is the position allocated for the Axes. The 'active' position is the position the Axes is actually drawn at. These positions are usually the same unless a fixed aspect is set to the Axes. See `.Axes.set_aspect` for details. Parameters ---------- pos : [left, bottom, width, height] or `~matplotlib.transforms.Bbox` The new position of the Axes in `.Figure` coordinates. which : {'both', 'active', 'original'}, default: 'both' Determines which position variables to change. See Also -------- matplotlib.transforms.Bbox.from_bounds matplotlib.transforms.Bbox.from_extents rFN)rf set_in_layout)r#posr s r' set_positionz_AxesBase.set_positions'. 3e, 5!r)c<t|tjstjj|}|j j |D]A}|dvr|jj||dvs'|jj|Cd|_ y)z Private version of set_position. Call this internally to get the same functionality of `set_position`, but not to take the axis out of the constrained_layout hierarchy. )ractive)rrTN) rrLBboxBaserNrOrJrLrrrstale)r#rr rRs r'rfz_AxesBase._set_positions#{334""..4C$$11$7 .B**   %,,$$((-  .  r)c|jj|D]'}|jd}|j|d)y)z Reset the active position to the original position. This undoes changes to the active position (as defined in `.set_position`) which may have been performed to satisfy fixed-aspect constraints. TrrrN)rJrLrgr)r#rRrs r'reset_positionz_AxesBase.reset_positionsD$$11$7 1B//4/0C OOCxO 0 1r)c ||_d|_y)z Set the Axes locator. Parameters ---------- locator : Callable[[Axes, Renderer], Bbox] TN)r%r)r#rs r'set_axes_locatorz_AxesBase.set_axes_locators% r)c|jS)z* Return the axes_locator. )r%rs r'rz_AxesBase.get_axes_locators!!!r)c|j|jd|js|j|j||_|j r|jj|yy)z4Set the boilerplate props for artists added to Axes.FrJN) r!rPis_transform_set set_transformrr get_mouseover_mouseover_setaddr#rs r'_set_artist_propsz_AxesBase._set_artist_propss_ T__%_01!!# OODNN + ??     # #A & r)c0tjdddS)a Returns ------- Patch The patch used to draw the background of the Axes. It is also used as the clipping path for any data elements on the Axes. In the standard Axes, this is a rectangle, but in other projections it may not be. Notes ----- Intended to be overridden by new projection types. )r?)r Rectanglers r'_gen_axes_patchz_AxesBase._gen_axes_patchs!!*c377r)cjdDcic]#}|tjj||%c}Scc}w)a} Returns ------- dict Mapping of spine names to `.Line2D` or `.Patch` instances that are used to draw Axes spines. In the standard Axes, spines are single line segments, but in other projections they may not be. Notes ----- Intended to be overridden by new projection types. )rrrr)r(Spine linear_spine)r# locationsoffsetrsides r'r+z_AxesBase._gen_axes_spiness> ?@gmm00t<<@ @@s(0ctjt||j||jur t d|j dj ||||_|jj|j_|jj|j_ |j\}}|j||d|j|jj|j_ y)a Share the x-axis with *other*. This is equivalent to passing ``sharex=other`` when constructing the Axes, and cannot be used if the x-axis is already being shared with another Axes. Note that it is not possible to unshare axes. otherNzx-axis is already sharedrFemitr)rrrrr9rIr;rr rget_xlimset_xlimget_autoscalex_on_scale)r#rx0x1s r'rz_AxesBase.sharex iu5 << #T\\(A78 8 ###D%0  ;;,,  ;;,, !B b"5u/F/F/H I!KK.. r)ctjt||j||jur t d|j dj ||||_|jj|j_|jj|j_ |j\}}|j||d|j|jj|j_ y)a Share the y-axis with *other*. This is equivalent to passing ``sharey=other`` when constructing the Axes, and cannot be used if the y-axis is already being shared with another Axes. Note that it is not possible to unshare axes. rNzy-axis is already sharedrFr)rrrrr9rIr;rr rget_ylimset_ylimget_autoscaley_onr)r#ry0y1s r'rz_AxesBase.shareyrr)c t|dr|jj}nd}|jj}|jj}|j j D]}|j|jj D]}|jd|_ tjgd|_ tjdr-|jj!t#j$tjdr-|jj!t#j$tjd|_tjd|_d |_d|_t/|_t/d |_tjd |_|j6gc}|_|D]}d |_d |_d |_|jt?|_ g|_!d |_"d |_#d |_$g|_%|jMd |jM|j4tjd tjdtOjPtjdtjd}tjd} | d} d|_)nd |_)tUjVd| d|dd|_,tUjVd| d|j[dd|_.tUjVd| d|j[dd|_/tjd} |ja| |jX|j\|j^fD]} |jc| |je|_|jjg|jid |jjk|jl|jjod|jjqd |jjs|jt|jw|jjy|j|jjy|j|jz6|jj}||jj}||j~6|jj}||jj}||j jD]`\} }t|d!| } | t|d"| | -|jd#k(r|jd$|jd d%d&b|jd|_Fy )'Clear the Axes.patchT) xlim_changed ylim_changed zlim_changed)signalszxtick.minor.visiblezytick.minor.visiblez axes.xmarginz axes.ymarginNrwz axes.gridFzaxes.grid.whichzaxes.grid.axis)r rzaxes.titlesizezaxes.titleweight)sizeweightz axes.titleyr?rbaselinerW)rrtextfontpropertiesverticalalignmenthorizontalalignmentrrrz axes.titlepadrJrr_sharesharepolarlinearr[r)Gr]r get_visiblerrrr|r1r_clearignore_existing_data_limitsr CallbackRegistryr9rgrhset_minor_locatormtickerAutoMinorLocator_xmargin_ymarginr_use_sticky_edgesrs _get_lines_get_patches_for_fill_gridOnr&_remove_method_parent_figurerr r child_axes_current_image_projection_initlegend_ containersr font_managerFontProperties _autotitleposmtextTextrar _left_title _right_title_set_title_offset_transrrr!rP set_facecolorr- set_edgecolor set_linewidthrr set_axis_on set_clip_pathr set_visiblerrrr@ _set_scale_set_limrr)r# patch_visible xaxis_visible yaxis_visiblerspine old_childrenchldpropsrtitle_offset_points_titler@rs r'__clearz_AxesBase.__clear!s 4 ! JJ224M M ..0  ..0 NN))+ D JJL [['') E LLN ,0(//DF <<- . JJ ( ()A)A)C D <<- . JJ ( ()A)A)C D ^4  ^4  !%02%;I%F"||K0 '+~~r$ dn  D"&D "&D DI  )m" $  % $,,cll3D&E||$45  7++./<< 235 LL ' 9A!%D !&D ZZQR ( (  !::QR ::<( & * "JJQR ::<( '  "ll?; $$%89zz4#3#3T5F5FG +F  " "6 * + ))+  doo5o9:   1   (   #   0    ,   , << # JJ " "= 1 JJ " "= 1 << # JJ " "= 1 JJ " "= 1....0 /JD$DF4&/2E -dVn-e499'OOH- a . / ! r)c^|jr|jy|jyrN)rCrA_AxesBase__clearrs r'r1z_AxesBase.clears  " " HHJ LLNr)c^|jr|jy|jyr/)rCr0r1rs r'rAz _AxesBase.clas  " " LLN JJLr)c>eZdZdZ d dZdZdZdZdZdZ d Z y) _AxesBase.ArtistLista A sublist of Axes children based on their type. The type-specific children sublists were made immutable in Matplotlib 3.7. In the future these artist lists may be replaced by tuples. Use as if this is a tuple already. Nc:||_||_fd|_y)a! Parameters ---------- axes : `~matplotlib.axes.Axes` The Axes from which this sublist will pull the children Artists. prop_name : str The property name used to access this sublist from the Axes; used to generate deprecation warnings. valid_types : list of type, optional A list of types that determine which children will be returned by this sublist. If specified, then the Artists in the sublist must be instances of any of these types. If unspecified, then any type of Artist is valid (unless limited by *invalid_types*.) invalid_types : tuple, optional A list of types that determine which children will *not* be returned by this sublist. If specified, then Artists in the sublist will never be an instance of these types. Otherwise, no types will be excluded. cN xs t|xr xs t| Sr-)r)artist invalid_types valid_typess r'z/_AxesBase.ArtistList.__init__..s4 CJv{$CM""K*V]*K&Kr)N)_axes _prop_name _type_check)r#rrr8r7s ``r'r(z_AxesBase.ArtistList.__init__s.DJ'DO D r)c:dt|d|jdS)Nz.s$;!''/;s)sumr:r&rs`r'__len__z_AxesBase.ArtistList.__len__s';%)ZZ%9%9;; ;r)c#Kt|jjD]}|j|s|ywr-)rr:r&r<)r#r6s r'__iter__z_AxesBase.ArtistList.__iter__s7tzz334 !##F+ L !s4>>c||jjDcgc]}|j|r|c}|Scc}wr-)r:r&r<)r#keyr6s r' __getitem__z _AxesBase.ArtistList.__getitem__sB"&**"6"61''/1146 61s9ct|ttjfrg||St|ttjfrg||St Sr-)rrr ArtistListtupleNotImplementedr#rs r'__add__z_AxesBase.ArtistList.__add__sN%$ (<(&&%%)=)=!>?&&! !r)ct|tr|t|zSt|tr|t|zStSr-)rrrJrKrLs r'__radd__z_AxesBase.ArtistList.__radd__s:%&tDz))%'uT{**! !r)NN) r5r4r6r"r(rbrBrDrGrMrOr.r)r'rIr3s0 6: < I ; !  6  " "r)rIc |j|dtjtjt j tjtjtjfS)Nartists)r7) rImcoll Collectionmimage AxesImagerarvrPatchmtableTablerrrs r'rRz_AxesBase.artistssHtY   f.. x~~ LL%**?&' 'r)cF|j|dtjS)N collectionsr8)rIrSrTrs r'r[z_AxesBase.collectionss%t]+0+;+;= =r)cF|j|dtjS)Nimagesr\)rIrUrVrs r'r^z_AxesBase.imagesstX6;K;KLLr)cF|j|dtjS)Nlinesr\)rIrarvrs r'r`z_AxesBase.lines stW&--HHr)cF|j|dtjS)Npatchesr\)rIrrWrs r'rbz_AxesBase.patchesstYHNNKKr)cF|j|dtjS)Ntablesr\)rIrXrYrs r'rdz_AxesBase.tablesstX6<<HHr)cF|j|dtjS)Ntextsr\)rIrrrs r'rfz_AxesBase.textsstW%**EEr)c6|jjS)zGet the facecolor of the Axes.)r get_facecolorrs r'rhz_AxesBase.get_facecolorszz''))r)cT||_d|_|jj|S)zx Set the facecolor of the Axes. Parameters ---------- color : :mpltype:`color` T)r-rrr)r#rls r'rz_AxesBase.set_facecolors'  zz''..r)c8tjd|dz |jdj|_|j |j |jfD];}|j|j|jz|jd=y)zw Set the offset for the title either from :rc:`axes.titlepad` or from set_title kwarg ``pad``. rrFrJN) rLrrPrtitleOffsetTransrarrrr set_clip_box)r#r+r,s r'rz!_AxesBase._set_title_offset_trans+s !, = =(2-U+;;!=zz4#3#3T5F5FG &F  $2G2G!G H    % &r)c|r |r tdt|dk(r|dd}n t|i|}|jj ||j j |y)a Set the property cycle of the Axes. The property cycle controls the style properties such as color, marker and linestyle of future plot commands. The style properties of data already added to the Axes are not modified. Call signatures:: set_prop_cycle(cycler) set_prop_cycle(label=values, label2=values2, ...) set_prop_cycle(label, values) Form 1 sets given `~cycler.Cycler` object. Form 2 creates a `~cycler.Cycler` which cycles over one or more properties simultaneously and set it as the property cycle of the Axes. If multiple properties are given, their value lists must have the same length. This is just a shortcut for explicitly creating a cycler and passing it to the function, i.e. it's short for ``set_prop_cycle(cycler(label=values, label2=values2, ...))``. Form 3 creates a `~cycler.Cycler` for a single property and set it as the property cycle of the Axes. This form exists for compatibility with the original `cycler.cycler` interface. Its use is discouraged in favor of the kwarg form, i.e. ``set_prop_cycle(label=values)``. Parameters ---------- cycler : `~cycler.Cycler` or ``None`` Set the given Cycler. *None* resets to the cycle defined by the current style. .. ACCEPTS: `~cycler.Cycler` label : str The property key. Must be a valid `.Artist` property. For example, 'color' or 'linestyle'. Aliases are allowed, such as 'c' for 'color' and 'lw' for 'linewidth'. values : iterable Finite-length iterable of the property values. These values are validated and will raise a ValueError if invalid. See Also -------- matplotlib.rcsetup.cycler Convenience function for creating validated cyclers for properties. cycler.cycler The original function for creating unvalidated cyclers. Examples -------- Setting the property cycle for a single property: >>> ax.set_prop_cycle(color=['red', 'green', 'blue']) Setting the property cycle for simultaneously cycling over multiple properties (e.g. red circle, green plus, blue cross): >>> ax.set_prop_cycle(color=['red', 'green', 'blue'], ... marker=['o', '+', 'x']) zCCannot supply both positional and keyword arguments to this method.r[rN)rr`rr r|r )r#r/r0 prop_cycles r'r|z_AxesBase.set_prop_cycle7skB F89 9 t9>d1goJ00J &&z2 ""11*=r)c|jS)z Return the aspect ratio of the Axes scaling. This is either "auto" or a float giving the ratio of y/x-scale. )rrs r' get_aspectz_AxesBase.get_aspects ||r)ctj|drd}tj|ds0t|}|dkstj|s t d|r?|j Dchc]'}|j|j|D]}|)}}}n|g}|D] }||_ | |j}|j||||j||d|_ ycc}}w) aK Set the aspect ratio of the Axes scaling, i.e. y/x-scale. Parameters ---------- aspect : {'auto', 'equal'} or float Possible values: - 'auto': fill the position rectangle with data. - 'equal': same as ``aspect=1``, i.e. same scaling for x and y. - *float*: The displayed size of 1 unit in y-data coordinates will be *aspect* times the displayed size of 1 unit in x-data coordinates; e.g. for ``aspect=2`` a square in data coordinates will be rendered with a height of twice its width. adjustable : None or {'box', 'datalim'}, optional If not ``None``, this defines which parameter will be adjusted to meet the required aspect. See `.set_adjustable` for further details. anchor : None or str or (float, float), optional If not ``None``, this defines where the Axes will be drawn if there is extra space due to aspect constraints. The most common way to specify the anchor are abbreviations of cardinal directions: ===== ===================== value description ===== ===================== 'C' centered 'SW' lower left corner 'S' middle of bottom edge 'SE' lower right corner etc. ===== ===================== See `~.Axes.set_anchor` for further details. share : bool, default: False If ``True``, apply the settings to all shared Axes. See Also -------- matplotlib.axes.Axes.set_adjustable Set how the Axes adjusts to achieve the required aspect ratio. matplotlib.axes.Axes.set_anchor Set the position in case of extra space. equalr[rrz#aspect must be finite and positive N)rT)r _str_equalfloatrisfiniter9rrIrLrrset_adjustable set_anchorr) r#aspect adjustableanchorrr@siblingrrRs r' set_aspectz_AxesBase.set_aspects `   FG ,F/6]F{"++f"5 !FGG (,(8(8O#'#4#4T#:#G#G#MOOGODO6D BBJ   ))J Je4   OOF%O 0 Os0,C/c|jS)a Return whether the Axes will adjust its physical dimension ('box') or its data limits ('datalim') to achieve the desired aspect ratio. See Also -------- matplotlib.axes.Axes.set_adjustable Set how the Axes adjusts to achieve the required aspect ratio. matplotlib.axes.Axes.set_aspect For a description of aspect handling. )rrs r'get_adjustablez_AxesBase.get_adjustablesr)c8tjddg||r?|jDchc]'}|j|j |D]}|)}}}n|g}|dk(rt d|Dr t d|D] }||_ d|_ycc}}w)a Set how the Axes adjusts to achieve the required aspect ratio. Parameters ---------- adjustable : {'box', 'datalim'} If 'box', change the physical dimensions of the Axes. If 'datalim', change the ``x`` or ``y`` data limits. This may ignore explicitly defined axis limits. share : bool, default: False If ``True``, apply the settings to all shared Axes. See Also -------- matplotlib.axes.Axes.set_aspect For a description of aspect handling. Notes ----- Shared Axes (of which twinned Axes are a special case) impose restrictions on how aspect ratios can be imposed. For twinned Axes, use 'datalim'. For Axes that share both x and y, use 'box'. Otherwise, either 'datalim' or 'box' may be used. These limitations are partly a requirement to avoid over-specification, and partly a result of the particular implementation we are currently using, in which the adjustments for aspect ratios are done sequentially and independently on each Axes as it is drawn. rdatalimryc3lK|],}t|jddtjk7.yw)__func__N)rget_data_ratior)rrRs r'rz+_AxesBase.set_adjustable..s5'  1 1:tD$334's24zPCannot set Axes adjustable to 'datalim' for Axes which override 'get_data_ratio'TN) rr{rrIrLrr9rr)r#ryrr@r{axsrRs r'rvz_AxesBase.set_adjustables> E9-*E '+'7'7Nt"&"3"3D"9"F"Ft"LNN7NCN&C ) #'"%'' DE E (B'BN ( Ns,Bc|jS)a Return the Axes box aspect, i.e. the ratio of height to width. The box aspect is ``None`` (i.e. chosen depending on the available figure space) unless explicitly specified. See Also -------- matplotlib.axes.Axes.set_box_aspect for a description of box aspect. matplotlib.axes.Axes.set_aspect for a description of aspect handling. ) _box_aspectrs r'get_box_aspectz_AxesBase.get_box_aspectsr)ch|jj||jj|}|#t|}|D]}|jd|D]}||_d|_y)aD Set the Axes box aspect, i.e. the ratio of height to width. This defines the aspect of the Axes in figure space and is not to be confused with the data aspect (see `~.Axes.set_aspect`). Parameters ---------- aspect : float or None Changes the physical dimensions of the Axes, such that the ratio of the Axes height to the Axes width in physical units is equal to *aspect*. Defining a box aspect will change the *adjustable* property to 'datalim' (see `~.Axes.set_adjustable`). *None* will disable a fixed box aspect so that height and width of the Axes are chosen independently. See Also -------- matplotlib.axes.Axes.set_aspect for a description of aspect handling. NrT)rJrLrtrvrr)r#rxrrRs r'r$z_AxesBase.set_box_aspect"s.7""//57""//57  6]F -!!), - B#BNBH r)c|jS)z Get the anchor location. See Also -------- matplotlib.axes.Axes.set_anchor for a description of the anchor. matplotlib.axes.Axes.set_aspect for a description of aspect handling. )rrs r' get_anchorz_AxesBase.get_anchorGs||r)c|tjjvsCt|dk(s5t ddj tjjz|r?|j Dchc]'}|j|j|D]}|)}}}n|g}|D] }||_ d|_ ycc}}w)ux Define the anchor location. The actual drawing area (active position) of the Axes may be smaller than the Bbox (original position) when a fixed aspect is required. The anchor defines where the drawing area will be located within the available space. Parameters ---------- anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} Either an (*x*, *y*) pair of relative coordinates (0 is left or bottom, 1 is right or top), 'C' (center), or a cardinal direction ('SW', southwest, is bottom left, etc.). str inputs are shorthands for (*x*, *y*) coordinates, as shown in the following diagram:: ┌─────────────────┬─────────────────┬─────────────────┐ │ 'NW' (0.0, 1.0) │ 'N' (0.5, 1.0) │ 'NE' (1.0, 1.0) │ ├─────────────────┼─────────────────┼─────────────────┤ │ 'W' (0.0, 0.5) │ 'C' (0.5, 0.5) │ 'E' (1.0, 0.5) │ ├─────────────────┼─────────────────┼─────────────────┤ │ 'SW' (0.0, 0.0) │ 'S' (0.5, 0.0) │ 'SE' (1.0, 0.0) │ └─────────────────┴─────────────────┴─────────────────┘ share : bool, default: False If ``True``, apply the settings to all shared Axes. See Also -------- matplotlib.axes.Axes.set_aspect for a description of aspect handling. rZzargument must be among %sr3TN) rLrNcoefsr`r9r;rrIrLrr)r#rzrr@r{rrRs r'rwz_AxesBase.set_anchorTsB+**000CK14D8!YY{'7'7'='=>?@ @ (,(8(8O#'#4#4T#:#G#G#MOOGODO6D BBJ  Os1,B:cT|jjj|j\}}|jjj|j \}}t t||z d}t t||z d}||z S)z Return the aspect ratio of the scaled data. Notes ----- This method is intended to be overridden by new projection types. KH9)rrrH get_xboundr get_yboundrabs)r#txmintxmaxtymintymaxxsizeysizes r'rz_AxesBase.get_data_ratioszz//1;;DOOdv}"||j>dv}#|"r |#r td|#rd}$n0|| kDr ||!kDr|dkDxr|dkxs |dkxr|dkD}%n|dkD}%|"xs|%}$|$rnd| |zz}&|&|dz z }|&|dz z}|jAstBjEd|jG| jIj/||gyd| | zz}'|'|dz z }|'|dz z}|jKstBjEd|jM| jIj/||gy)a Adjust the Axes for a specified data aspect ratio. Depending on `.get_adjustable` this will modify either the Axes box (position) or the view limits. In the former case, `~matplotlib.axes.Axes.get_anchor` will affect the position. Parameters ---------- position : None or .Bbox .. note:: This parameter exists for historic reasons and is considered internal. End users should not use it. If not ``None``, this defines the position of the Axes within the figure as a Bbox. See `~.Axes.get_position` for further details. Notes ----- This is called automatically when each Axes is drawn. You may need to call it yourself if you need to update the Axes position and/or view limits before the Figure is drawn. An alternative with a broader scope is `.Figure.draw_without_rendering`, which updates all stale components of a figure, not only the positioning / view limits of a single Axes. See Also -------- matplotlib.axes.Axes.set_aspect For a description of aspect ratio handling. matplotlib.axes.Axes.set_adjustable Set how the Axes adjusts to achieve the required aspect ratio. matplotlib.axes.Axes.set_anchor Set the position in case of extra space. matplotlib.figure.Figure.draw_without_rendering Update all stale components of a figure. Examples -------- A typical usage example would be the following. `~.Axes.imshow` sets the aspect to 1, but adapting the Axes position and extent to reflect this is deferred until rendering for performance reasons. If you want to know the Axes size before, you need to call `.apply_aspect` to get the correct values. >>> fig, ax = plt.subplots() >>> ax.imshow(np.zeros((3, 3))) >>> ax.bbox.width, ax.bbox.height (496.0, 369.59999999999997) >>> ax.apply_aspect() >>> ax.bbox.width, ax.bbox.height (369.59999999999997, 369.59999999999997) NTrrrrFrJrzHAdjustable 'box' is not allowed in a twinned Axes; use 'datalim' insteadrr[g{Gzt?g?rrrzset_aspect(..., adjustable='datalim') or axis('equal') are not allowed when both axes are shared. Try set_aspect(..., adjustable='box').r@zQIgnoring fixed y limits to fulfill fixed data aspect with adjustable data limits.zQIgnoring fixed x limits to fulfill fixed data aspect with adjustable data limits.)'rgrprrfrPrQrLrNr transformedrrrrJ RuntimeErrorrrshrunk_to_aspectanchoredrrrrrHrrrrr intervalx intervalyrIr_logwarning set_yboundinvertedr set_xbound)(r#positionrxtransbb fig_aspectrpbpb1x_trfy_trfxminxmaxyminymaxrr data_ratio y_expanderdLrrrrxryrxmargymargYsizeXsizeXmargYmargxmymshared_xshared_yadjust_yadjyycxcs( r'rz_AxesBase.apply_aspectsr  (($(7H" V  0 0 8   xx  8 U+::    " " $ 0 0 7YY)   u $t)))"$IJJ$"5"5"77J"B%%j"jAC   s||DOO,=rBH M     '"B%%d&6&6JGC   s||DOO,=rBH M    #   xx  8||DOO$5r:H ((* ((*__T__%67 d__T__%67 dCt $e,Ct $e,8??X^^#CD &( %'%/!3 z?U "  \\.B.B R"W  R"W   U" "    4,,S114,,S11  45 5 Hrzebj5zA~75zA~"A~'4H t $Beck!Beck!B))+ <= OOENN,66Bx@ At $Beck!Beck!B))+ <= OOENN,66Bx@ Ar))rc t|ttfr|durd}|durd}|j}|dk(r|j n|dk(r|j n|dvr|j d|jd|jd|dk(r|jdd n{|d k(r'|jdd d |j dnO|dk(r%|jd|j dn%|dk(r9|jd|j d|jdd d n|dk(r|jdd d |j d|j}|j}ttj|tj|d}|j|d|d|zg|d|j|d|d|zg|dn't!d|d|t#|dt#|j$zk7r:t'dj)dj+d|j$Dt-|j$Dcic]\}}||d|zd|dzz} }}nDi} |j$D]3}|j/|dd} |j/|dd} | | f| |<5| j1D],\}\} } | | dnd} t3|d|d} | | | || .|rt5j6d |d!}|j$D]}t3|d"|d}||z }|Scc}}w)#a Convenience method to get or set some axis properties. Call signatures:: xmin, xmax, ymin, ymax = axis() xmin, xmax, ymin, ymax = axis([xmin, xmax, ymin, ymax]) xmin, xmax, ymin, ymax = axis(option) xmin, xmax, ymin, ymax = axis(**kwargs) Parameters ---------- xmin, xmax, ymin, ymax : float, optional The axis limits to be set. This can also be achieved using :: ax.set(xlim=(xmin, xmax), ylim=(ymin, ymax)) option : bool or str If a bool, turns axis lines and labels on or off. If a string, possible values are: ================ =========================================================== Value Description ================ =========================================================== 'off' or `False` Hide all axis decorations, i.e. axis labels, spines, tick marks, tick labels, and grid lines. This is the same as `~.Axes.set_axis_off()`. 'on' or `True` Do not hide all axis decorations, i.e. axis labels, spines, tick marks, tick labels, and grid lines. This is the same as `~.Axes.set_axis_on()`. 'equal' Set equal scaling (i.e., make circles circular) by changing the axis limits. This is the same as ``ax.set_aspect('equal', adjustable='datalim')``. Explicit data limits may not be respected in this case. 'scaled' Set equal scaling (i.e., make circles circular) by changing dimensions of the plot box. This is the same as ``ax.set_aspect('equal', adjustable='box', anchor='C')``. Additionally, further autoscaling will be disabled. 'tight' Set limits just large enough to show all data, then disable further autoscaling. 'auto' Automatic scaling (fill plot box with data). 'image' 'scaled' with axis limits equal to data limits. 'square' Square plot; similar to 'scaled', but initially forcing ``xmax-xmin == ymax-ymin``. ================ =========================================================== emit : bool, default: True Whether observers are notified of the axis limit change. This option is passed on to `~.Axes.set_xlim` and `~.Axes.set_ylim`. Returns ------- xmin, xmax, ymin, ymax : float The axis limits. See Also -------- matplotlib.axes.Axes.set_xlim matplotlib.axes.Axes.set_ylim Notes ----- For 3D Axes, this method additionally takes *zmin*, *zmax* as parameters and likewise returns them. TonFoff)rrrscaledrimagesquarerrrrrrrrr\)ryrzrrrrrzUnrecognized string z to axis; try 'on' or 'off'NrZzAThe first argument to axis() must be an iterable of the form [{}]r3c3,K|] }|d|dyw)zmin, rNr.)rr@s r'rz!_AxesBase.axis..s$0R8OOG OBH_OOGcOJ))%0G^''d'3))%0G^''d'3))%0OOGcOJH_OOGcOJ))%0==?D==?D #BGGDM2774= A! DIMM47DGi,?"@'+%"9MM47DGi,?"@'+%"9!#7w?5"566s8qT%5%5!666#%vdii0R@D@P@P0R'R STT $-T-=-=#>4#ac!QqS'**  ,,4D#ZZ4& d;F#ZZ4& d;F$*F#3F4L4+1,,. D&&vv$n %%TT$s+;< 667C  D ""662 2$$ !D dV3'78J JL D ! -sM7c|jS)z?Return the `.Legend` instance, or None if no legend is defined.)rrs r' get_legendz_AxesBase.get_legends ||r)cBtjd|jS)z6Return a list of `.AxesImage`\s contained by the Axes.rV)r silent_listr^rs r' get_imagesz_AxesBase.get_imagess  dkk::r)cBtjd|jS)z-Return a list of lines contained by the Axes.rv)r rr`rs r' get_linesz_AxesBase.get_liness  4::66r)c|jS)z [*Discouraged*] Return the XAxis instance. .. admonition:: Discouraged The use of this function is discouraged. You should instead directly access the attribute `~.Axes.xaxis`. )rrs r' get_xaxisz_AxesBase.get_xaxiszzr)c|jS)z [*Discouraged*] Return the YAxis instance. .. admonition:: Discouraged The use of this function is discouraged. You should instead directly access the attribute `~.Axes.yaxis`. )rrs r' get_yaxisz_AxesBase.get_yaxisrr) get_gridlines get_ticklinesctjtjtj f|||j vr td||_y)z Set the current image. This image will be the target of colormap functions like ``pyplot.viridis``, and other functions such as `~.pyplot.clim`. The current image is an attribute of the current Axes. )imz4Argument must be an image or collection in this AxesN) rrrSrTrUrVr&r9r)r#rs r'_sciz_AxesBase._scisE u//1A1ABrJ T^^ #ST T r)c|jS)z:Helper for `~matplotlib.pyplot.gci`; do not use elsewhere.)rrs r'_gciz_AxesBase._gcis"""r)c:td|jDS)z Return whether any artists have been added to the Axes. This should not be used to determine whether the *dataLim* need to be updated, and may not actually be useful for anything. c3K|]L}t|tjtjt j tjfNywr-) rrSrTrUrVrarvrrW)rrs r'rz%_AxesBase.has_data.. sC,a%"2"2F4D4D"(--"AB,sAA)rr&rs r'has_dataz_AxesBase.has_datas", NN,, ,r)c||_|jj||jj|_|j ||j |j|jd|_ |S)a Add an `.Artist` to the Axes; return the artist. Use `add_artist` only for artists for which there is no dedicated "add" method; and if necessary, use a method such as `update_datalim` to manually update the `~.Axes.dataLim` if the artist is to be included in autoscaling. If no ``transform`` has been specified when creating the artist (e.g. ``artist.get_transform() == None``) then the transform is set to ``ax.transData``. T) rr&r remover r get_clip_pathr rrrs r' add_artistz_AxesBase.add_artist sf a >>00 q! ??  $ OODJJ ' r)c||_tj|_|jj |t j|jdj|jg|_ d|_ |S)z Add an `.Axes` to the Axes' children; return the child Axes. This is the lowlevel version. See `.axes.Axes.inset_axes`. FrJ)ownersT) r:martist_stale_axes_callbackstale_callbackrr functoolspartialrP _remove_axesr r)r#rRs r'add_child_axesz_AxesBase.add_child_axes sh#88 r"%-- OOO ' 4 4doo=NP  r)ctjtj||j s'|j dt |j|jj||jj|_ |j||j|j|j|r|j|j!|j"}|j%}t'j(|j*j-s"t'j.||j*gg}|j1j3|j"\}}|j5j3|j"\}}|j7||xs||xs|d|_|S)zI Add a `.Collection` to the Axes; return the collection. ) collection_childupdatexupdateyT)rrrSrTr\r r`r&r rr rrr rr get_datalimr get_pointsrisinfminposr concatenatercontains_branch_seperatelyget_offset_transformupdate_datalimr) r#rautolimrpoints x_is_data y_is_data ox_is_data oy_is_datas r'add_collectionz_AxesBase.add_collection- s e..:F##%  6#dnn*=)>!? @ j)$(NN$9$9 ! z*  # # % -  $ $TZZ 0   ! ! # ,,T^^%?%?%O !Iy&0&E&E&G'A'A$..'Q #J   !/Z!/Z    r)cZtjtj||j ||j s'|j dt|j|jj||jj|_ d|_ |S)zD Add an `.AxesImage` to the Axes; return the image. )rrT) rrrUrVrr\r r`r&r rr r)r#rs r' add_imagez_AxesBase.add_imageW s f..e< u% OOfS%8$9: ; e$#~~44  r)cp|j\}}}}|jj||f||ffyr-) get_extentrr)r#rrrrrs r'_update_image_limitsz_AxesBase._update_image_limitsd s8!&!1!1!3dD$   4,t !=>r)ctjtj||j ||j |j |j|j||js'|jdt|j|jj||jj|_d|_|S)z? Add a `.Line2D` to the Axes; return the line. )linerT)rrrarvrrr r_update_line_limitsr\r r`r&r rr r)r#rs r'add_linez_AxesBase.add_lineh s fmm$7 t$     '   tzz *   &~~ NNVC$7#89 : d#"nn33  r)ctjtj||j ||j j ||j j|_d|_ |S)z= Add a `.Text` to the Axes; return the text. )txtT) rrrrrr&r rr r)r#r!s r' _add_textz_AxesBase._add_texty sV ejjc2 s# c"!^^22  r)c|j}|jjdk(ry|j}||jk(r|}nt |j |jrl||jz }|jjr5|j}|j\}}|j|}n|j|}n|}|jjsy|j |j\} } |jdk7r.| r||jk(rd} | r||jk(rd} |jj!||j"| | d|_y)zY Figures out the data limit of the given line, updating `.Axes.dataLim`. rNrFr)get_pathverticesrrrrr  is_affine_get_transformed_pathget_transformed_path_and_affinetransform_path_affinetransform_pathr@rrrupdate_from_pathr) r#rpathline_trf data_path trf_to_dataline_trans_pathna_path_rrs r'rz_AxesBase._update_line_limits sY}} ==   " %%' t~~ %I 44T^^D E"T^^3K~~''"&"<"<">,LLN '==gF '66t< I!!&& #>>t~~N 99 %8t'?'?'AA8t'?'?'AA %%i&*&F&F.5w & H,1(r)cVtjtj||j ||j |j |j|j||jj||jj|_ |S)z? Add a `.Patch` to the Axes; return the patch. )p) rrrrWrrr r_update_patch_limitsr&r rr )r#r4s r' add_patchz_AxesBase.add_patch sz hnn2 q! ??  $ OODJJ ' !!!$ a >>00r)ct|tjr!|js|j sy|j }g}|j dD]4\}}|j\}}|j|dg|d6t|rtj|}|j}|j|j\} } | s| sy|jdk7r.| r||j!k(rd} | r||j#k(rd} ||jz } | j%|} |j'| | | y)z+Update the data limits for the given patch.NF)simplifyrr[rr)rrr get_width get_heightr$ iter_bezieraxis_aligned_extremar r`rvstackrr rr@rrrHr) r#rr4r%curvecoder2dzeros patch_trfrrr/xyss r'r5z_AxesBase._update_patch_limits s? uh00 1oo'%2B2B2D  NN ==%=8 4KE4224IAv OOE1/v/q/2 3  4 x=yy*H'') $??O7  99 %9(@(@(BB9(@(@(BB$..0 ##H- C'Br)c4tjtj||j ||j j ||j|j|j|j j|_ |S)z? Add a `.Table` to the Axes; return the table. )tab) rrrXrYrr&r rr rrr )r#rDs r' add_tablez_AxesBase.add_table sp fll4 s# c"     &   djj )!^^22 r)c|j}|s'|jdt|jz|jj ||jj |_|S)zS Add a `.Container` to the Axes' containers; return the container. z _container%d)r\r r`rr rr )r# containerrs r' add_containerz_AxesBase.add_container s[##%   T__1E E F y)#'??#9#9  r)c"|*tj|j|tSt j |j ||jD]}|j|j|j|y)zW Process axis units changes: requests updates to data and view limits. N)event) axis_name) rrr;objectrr{rr`recache_alwaysrelimr)r#rKrJrs r'r;z_AxesBase._unit_change_handler sw =$$))9FHF F 4>>Y?JJ "D    ! "  $$Y/r)c"|jjd|jjtjj j d|_|jD]}|r|jst|tjr|j|Bt|tjr|j!|nt|t"j$s|j'|y)a  Recompute the data limits based on current artists. At present, `.Collection` instances are not supported. Parameters ---------- visible_only : bool, default: False Whether to exclude invisible artists. TN)rr set_pointsrLrNrrr rr&rrrarvrrrWr5rUrVr)r# visible_onlyr6s r'rNz_AxesBase.relim s D!  0 0 5 5 7 B B DE+/(nn 6F6#5#5#7ffmm4,,V47--f5(8(89--f5 6r)ctj|}tjtj|sy|jj ||j ||d|_y)ak Extend the `~.Axes.dataLim` Bbox to include the given points. If no data is set currently, the Bbox will ignore its limits and set the bound to be the bounds of the xydata (*xys*). Otherwise, it will compute the bounds of the union of its current data and the data in *xys*. Parameters ---------- xys : 2D array-like The points to include in the data limits Bbox. This can be either a list of (x, y) tuples or a (N, 2) array. updatex, updatey : bool, default: True Whether to update the x/y limits. NrF)rasarrayrrurupdate_from_data_xyr)r#rBrrs r'rz_AxesBase.update_datalim' sX$jjovvbkk#&'  ((d.N.N18' ) K+0(r))convertc|xsg}|xsi}|j}|D]3\}} ||}|||jr#|j |5|j D]\}}| |j |d|j}|jdk(rddd} |j | ||}||jk7sa|d|j||D]\} }| |k(s ||j |!|Dcgc]\}}|r|||j|n|!c}}S#t$rtd|dwxYwcc}}w)a Set axis units based on *datasets* and *kwargs*, and optionally apply unit conversions to *datasets*. Parameters ---------- datasets : list List of (axis_name, dataset) pairs (where the axis name is defined as in `._axis_map`). Individual datasets can also be None (which gets passed through). kwargs : dict Other parameters from which unit info (i.e., the *xunits*, *yunits*, *zunits* (for 3D Axes), *runits* and *thetaunits* (for polar) entries) is popped, if present. Note that this dict is mutated in-place! convert : bool, default: True Whether to return the original datasets or the converted ones. Returns ------- list Either the original datasets if *convert* is False, or the converted ones if *convert* is True (the default). zInvalid axis name: Nrr thetaunitsrunitsr) rKeyErrorr9 have_unitsrrrrr@ set_units convert_units) r#datasetsr0rUaxis_maprKrrr polar_unitsdataset_axis_names r'rz_AxesBase._process_unit_info@ s:>r2>>' (OIt P *D$4T__=N!!$' ( (~~/ 0OIt|JJ)E2DJJ?EyyG#$0x@  ;y#95A "u'8u%080+%t(I5$:J))$/0 0&(01#Itt/#11$759:1 1- P #6ym!DE4O P,1sD)$E)Ec>|jj|dS)zT Return whether the given event (in display coords) is in the Axes. rrcontainsr# mouseevents r'in_axesz_AxesBase.in_axes} szz"":.q11r)_get_autoscale_on_set_autoscale_oncVtd|jjDS)z8Return True if each axis is autoscaled, False otherwise.c3<K|]}|jywr-)rg)rrs r'rz-_AxesBase.get_autoscale_on.. s!8))+8)rrr|rs r'get_autoscale_onz_AxesBase.get_autoscale_on s)8#~~44688 8r)cd|jjD]}|j|y)z Set whether autoscaling is applied to each axis on the next draw or call to `.Axes.autoscale_view`. Parameters ---------- b : bool N)rr|rh)r#brs r'rz_AxesBase.set_autoscale_on s.NN))+ &D  " "1 % &r)c|jS)a When autoscaling, whether to obey all `.Artist.sticky_edges`. Default is ``True``. Setting this to ``False`` ensures that the specified margins will be applied, even if the plot includes an image, for example, which would otherwise force a view limit to coincide with its data limit. The changing this property does not change the plot until `autoscale` or `autoscale_view` is called. )r rs r'use_sticky_edgesz_AxesBase.use_sticky_edges s%%%r)c$t||_yr-)rr r#rns r'rpz_AxesBase.use_sticky_edges s!%ar)c|jS)z Retrieve autoscaling margin of the x-axis. .. versionadded:: 3.9 Returns ------- xmargin : float See Also -------- matplotlib.axes.Axes.set_xmargin )rrs r' get_xmarginz_AxesBase.get_xmargin }}r)c|jS)z Retrieve autoscaling margin of the y-axis. .. versionadded:: 3.9 Returns ------- ymargin : float See Also -------- matplotlib.axes.Axes.set_ymargin )rrs r' get_ymarginz_AxesBase.get_ymargin rur)cb|dkr td||_|jdd|_y)a Set padding of X data limits prior to autoscaling. *m* times the data interval will be added to each end of that interval before it is used in autoscaling. If *m* is negative, this will clip the data range instead of expanding it. For example, if your data is in the range [0, 2], a margin of 0.1 will result in a range [-0.2, 2.2]; a margin of -0.1 will result in a range of [0.2, 1.8]. Parameters ---------- m : float greater than -0.5 margin must be greater than -0.5rTN)r9rrrr#ms r' set_xmarginz_AxesBase.set_xmargin 3 9?@ @  $$S) r)cb|dkr td||_|jdd|_y)a Set padding of Y data limits prior to autoscaling. *m* times the data interval will be added to each end of that interval before it is used in autoscaling. If *m* is negative, this will clip the data range instead of expanding it. For example, if your data is in the range [0, 2], a margin of 0.1 will result in a range [-0.2, 2.2]; a margin of -0.1 will result in a range of [0.2, 1.8]. Parameters ---------- m : float greater than -0.5 ryrzrTN)r9rrrr{s r' set_ymarginz_AxesBase.set_ymargin r~r))rrrcf|r|| tdt|dk(r|dx}}n!t|dk(r|\}}n |r td|7|5|durtjd|d |j|j fS|||_||j|||j|yy) an Set or retrieve margins around the data for autoscaling axis limits. This allows to configure the padding around the data without having to set explicit limits using `~.Axes.set_xlim` / `~.Axes.set_ylim`. Autoscaling determines the axis limits by adding *margin* times the data interval as padding around the data. See the following illustration: .. plot:: _embedded_plots/axes_margins.py All input parameters must be floats greater than -0.5. Passing both positional and keyword arguments is invalid and will raise a TypeError. If no arguments (positional or otherwise) are provided, the current margins will remain unchanged and simply be returned. The default margins are :rc:`axes.xmargin` and :rc:`axes.ymargin`. Parameters ---------- *margins : float, optional If a single positional argument is provided, it specifies both margins of the x-axis and y-axis limits. If two positional arguments are provided, they will be interpreted as *xmargin*, *ymargin*. If setting the margin on a single axis is desired, use the keyword arguments described below. x, y : float, optional Specific margin values for the x-axis and y-axis, respectively. These cannot be used with positional arguments, but can be used individually to alter on e.g., only the y-axis. tight : bool or None, default: True The *tight* parameter is passed to `~.axes.Axes.autoscale_view`, which is executed after a margin is changed; the default here is *True*, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting *tight* to *None* preserves the previous setting. Returns ------- xmargin, ymargin : float Notes ----- If a previously used Axes method such as :meth:`pcolor` has set `~.Axes.use_sticky_edges` to `True`, only the limits not set by the "sticky artists" will be modified. To force all margins to be set, set `~.Axes.use_sticky_edges` to `False` before calling :meth:`margins`. See Also -------- .Axes.set_xmargin, .Axes.set_ymargin NzACannot pass both positional and keyword arguments for x and/or y.r[rrZzVMust pass a single positional argument for all margins, or one for each margin (x, y).Tzignoring tight=z in get mode) rr`rrrrrr}r)r#rrrmarginss r'rz_AxesBase.margins sv  89 9 \Q AJ A \Q DAq FG G 9D ""_UI\#JK==$--/ /  DK =   Q  =   Q  r)c ||_d|_y)a Set the zorder threshold for rasterization for vector graphics output. All artists with a zorder below the given value will be rasterized if they support rasterization. This setting is ignored for pixel-based output. See also :doc:`/gallery/misc/rasterization_demo`. Parameters ---------- z : float or None The zorder below which artists are rasterized. If ``None`` rasterization based on zorder is deactivated. TN)r0r)r#zs r'set_rasterization_zorderz"_AxesBase.set_rasterization_zorderM s"&'" r)c|jS)z?Return the zorder value below which artists will be rasterized.)r0rs r'get_rasterization_zorderz"_AxesBase.get_rasterization_zordera s)))r)cX|d}d}nb|dvr+|jt||j}nd}|dvr+|jt||j }nd}|r |rd|_|r |rd|_|r|jd||r|jd |yy) a Autoscale the axis view to the data (toggle). Convenience method for simple axis view autoscaling. It turns autoscaling on or off, and then, if autoscaling for either axis is on, it performs the autoscaling on the specified axis or Axes. Parameters ---------- enable : bool or None, default: True True turns autoscaling on, False turns it off. None leaves the autoscaling state unchanged. axis : {'both', 'x', 'y'}, default: 'both' The axis on which to operate. (For 3D Axes, *axis* can also be set to 'z', and 'both' refers to all three Axes.) tight : bool or None, default: None If True, first set the margins to zero. Then, this argument is forwarded to `~.axes.Axes.autoscale_view` (regardless of its value); see the description of its behavior there. NTrrFrrrrrr)set_autoscalex_onrrset_autoscaley_onrrrr)r#enablerrscalexscaleys r' autoscalez_AxesBase.autoscalee s, >FF}$&&tF|4//1}$&&tF|4//1 VDM VDM   ( (E ( :   ( (E ( : r)c P|t|_tjgx}}jr6j r|rj r}tjtjjdjDcgc]-}|jD]}|jj/c}}}jr|rjr}tjtjjdjDcgc]-}|jD]}|jj /c}}}j#dk(r||dkD}j%dk(r||dkD}fd}||jddj&j |j(||jddj*j|j,ycc}}wcc}}w)a Autoscale the view limits using the data limits. Parameters ---------- tight : bool or None If *True*, only expand the axis limits using the margins. Note that unlike for `autoscale`, ``tight=True`` does *not* set the margins to zero. If *False* and :rc:`axes.autolimit_mode` is 'round_numbers', then after expansion by the margins, further expand the axis limits using the axis major locator. If None (the default), reuse the value set in the previous call to `autoscale_view` (the initial value is False, but the default style sets :rc:`axes.autolimit_mode` to 'data', in which case this behaves like True). scalex : bool, default: True Whether to autoscale the x-axis. scaley : bool, default: True Whether to autoscale the y-axis. Notes ----- The autoscaling preserves any preexisting axis direction reversal. The data limits are not updated automatically when artist data are changed after the artist has been added to an Axes instance. In that case, use :meth:`matplotlib.axes.Axes.relim` prior to calling autoscale_view. If the views of the Axes are fixed, e.g. via `set_xlim`, they will not be changed by autoscale_view(). See :meth:`matplotlib.axes.Axes.autoscale` for an alternative. Nrrlogrc p|r|jsy|j}|D cgc]7}t|jdD]} t j | r| 9} }} | rt | t| } } n@tjdrytj tj} } |j} | j| | \} } t fd|D}dt| | z z}|j| |zdz }|dk7r||nd}|j| |z }|t|k7r||nd}|j}|j!}|j"j%| | |\} } |j'| | g\}}||z |z}t j |sd}|j'||z ||zg\} } | t| |} | t | |} j(s| j+| | \} } || | ycc} }w)Nintervalmutatedc3PK|]}t|jdyw)r N)rrrzs r'rzG_AxesBase.autoscale_view..handle_single_axis.. s)!G9; fTFO4!Gs#&gh㈵>r[rr)rgrLrrrrurrrsinfget_major_locator nonsingularr searchsortedr`rrrlimit_range_for_scalerHr view_limits)r{rPr@rmarginstickies set_boundsharedrRrr|rrrminimum_minpostoli0x0boundi1x1boundrH inverse_transx0tx1tdeltar#s ` r'handle_single_axisz4_AxesBase.autoscale_view..handle_single_axis sGd446 --d3F%++b!(xv5F!G+S)+c+F+f+s6{B9'$(89;66'266B,,.G((R0FB !G?E!GGNR"W%C&&rCx014B&(BhhrlDG&&rCx0B&(CM&9hrltG**,I%..0M[[66r2~NFB **B84HC3Y&(E;;u%",,cEk3;-GHFB"W%"W%;; ,,R4B b" e+sj;sC|j<j>j+|}|jA|j+||s|j4}|d krtjd y|j1|jB|ks|jDjGjId |f\} } |j9| | f|j1|jB|ksq|jDjGjId d|z|j1|jBz f\} } |j9| | ft3d|D} |D](}|j7\} } |j9| | f*y)z Update the title position based on the bounding box enclosing all the ticklabels and x-axis spine and xlabel... Nz2title position was updated manually, not adjustingc3<K|]}|jywr-)r^rras r'rz3_AxesBase._update_title_position.. s85>>#8rkFrJra)runknownroutlinerrz1top of Axes not in the figure, so title not movedrrZc3BK|]}|jdyw)r[N)rgrs r'rz3_AxesBase._update_title_position..R s?u5%%'*?s)%rrdebugrarrrrupdaterrJrLrP_align_label_groupsrrrrrget_ticks_positionget_label_position get_tightbboxrrrlrrrgrr^r offsetText intersectionrrrrH) r#rSr`rrRrrrrarr2rrs r'_update_title_positionz _AxesBase._update_title_position s^    )$2D2D JJK L **d..0A0AB888 e 4??# 4%%22489 OOO ' ; ;G D Q QRV W Y// JB))+G OOwGD(3D I Jvvg $BB++-1CCHH//1U:XX++H5zYY]]9b1CCEc277#C $ /E%%'DAq   3x (~~*BHH**84xx**335XX00>>xH??5+>+>x+H"M"$''C * Qw NO&&x055;~~..0::As8D1""Aq6***8499C?>>224>>QWu'>'>x'H'M'MMNPDAq&&1v.1 /4??? *E%%'DAq   4y ) *r)c| td|jsy|j|jd|j d|_|j }|j|r |||nd|j}|j|j|jr |js0|jjD]}|j||j||js0|j jD]}|j||j#dj$j's9|Dcgc].}|j)rt+|t,j.r|0}}t1|t3d}|j4}|O|rM|dj6|kr;t9j:|Dcgc]}|j6c}|d } |d| } || d}ng} |jr/|jr#| r|jg| z} n|jg|z}| rt=|j#d| |t-j>||||j#dj@|jCdd |_"ycc}wcc}w) NzNo renderer definedr)gidTrJzorderrFrr)rF)#rrr open_groupget_gidrOrrrrraxisonr.rr|rrrPcanvas is_saving get_animatedrrUrVsortedrr0rrr_draw_rasterized_draw_list_compositing_imagessuppressComposite close_groupr) r#rSrrRr'_axisrrasterization_zorderart split_indexartists_rasterizeds r'drawz_AxesBase.drawY s  45 5!  F 7 '') W'$1$G##%tzz"   ++- &u% & ##H-{{..0 &u% &D)00::<"L~~':a9I9I+JLGLj&:; $99 ,GAJ--0DD//'.//$7K")+!6 kl+G!#  ;;4==!&*jj\4F%F"::,0  T__$_79KX V,, dGT__$_%?%Q%Q S V$ CL0s 13K1Kcv|j|jdjjy)z5 Efficiently redraw a single artist. TrJN)rrPr get_rendererrs r' draw_artistz_AxesBase.draw_artist s* tD)00==?@r)ct5}g|jj|j|j|j D]#}|j |jd%|j|jdjjdddy#1swYyxYw)zP Efficiently redraw Axes data, but not axis ticks, labels, etc. F)visibleTrJN) rrr|rarr enter_context_cm_setrrPrr)r#rr6s r'redraw_in_framez_AxesBase.redraw_in_frame s[ HELDNN113L::L'+'7'7L9=9J9JL C##FNN5N$AB C IIdoo4o077DDF G  H H Hs B B44B=c|jS)z.Get whether the Axes rectangle patch is drawn.)r.rs r' get_frame_onz_AxesBase.get_frame_on s }}r)c ||_d|_y)zx Set whether the Axes rectangle patch is drawn. Parameters ---------- b : bool TN)r.rrrs r' set_frame_onz_AxesBase.set_frame_on s  r)c|jS)z Get whether axis ticks and gridlines are above or below most artists. Returns ------- bool or 'line' See Also -------- set_axisbelow ) _axisbelowrs r' get_axisbelowz_AxesBase.get_axisbelow sr)ct|x|_}dddd|}|jjD]}|j |d|_y)a Set whether axis ticks and gridlines are above or below most artists. This controls the zorder of the ticks and gridlines. For more information on the zorder see :doc:`/gallery/misc/zorder_demo`. Parameters ---------- b : bool or 'line' Possible values: - *True* (zorder = 0.5): Ticks and gridlines are below patches and lines, though still above images. - 'line' (zorder = 1.5): Ticks and gridlines are above patches (e.g. rectangles, with default zorder = 1) but still below lines and markers (with their default zorder = 2). - *False* (zorder = 2.5): Ticks and gridlines are above patches and lines / markers. Notes ----- For more control, call the `~.Artist.set_zorder` method of each axis. See Also -------- get_axisbelow rg?g@)TrFTN)rrrr| set_zorderr)r#rn axisbelowrrs r'r/z_AxesBase.set_axisbelow s`:'9&;;)    NN))+ $D OOF # $ r)c tjgd||dvr|jj|fd|i||dvr |jj|fd|i|yy)a Configure the grid lines. Parameters ---------- visible : bool or None, optional Whether to show the grid lines. If any *kwargs* are supplied, it is assumed you want the grid on and *visible* will be set to True. If *visible* is *None* and there are no *kwargs*, this toggles the visibility of the lines. which : {'major', 'minor', 'both'}, optional The grid lines to apply the changes on. axis : {'both', 'x', 'y'}, optional The axis to apply the changes on. **kwargs : `~matplotlib.lines.Line2D` properties Define the line properties of the grid, e.g.:: grid(color='r', linestyle='-', linewidth=2) Valid keyword arguments are: %(Line2D:kwdoc)s Notes ----- The axis is drawn as a unit, so the effective zorder for drawing the grid is determined by the zorder of each axis, not by the zorder of the `.Line2D` objects comprising the grid. Therefore, to set grid zorder, use `.set_axisbelow` or, for more control, call the `~.Artist.set_zorder` method of each axis. rrrrrr rN)rr{rrr)r#rr rr0s r'rz_AxesBase.grid scJ -D9 = DJJOOG ;5 ;F ; = DJJOOG ;5 ;F ; !r))rstyle scilimits useOffset useLocale useMathTextct|tr|j}|j}| |\}}||zdzdddddd} t j | |} i|jjD cic] \} } | | g c} } dt|jji}t j || } |D]}| %|jjj| |%|jjj||%|jjj||%|jjj!|||jjj#|y#ttf$r} td| d} ~ wwxYwcc} } w#t$$r} t%d | d} ~ wwxYw) a Configure the `.ScalarFormatter` used by default for linear Axes. If a parameter is not set, the corresponding property of the formatter is left unchanged. Parameters ---------- axis : {'x', 'y', 'both'}, default: 'both' The axis to configure. Only major ticks are affected. style : {'sci', 'scientific', 'plain'} Whether to use scientific notation. The formatter default is to use scientific notation. 'sci' is equivalent to 'scientific'. scilimits : pair of ints (m, n) Scientific notation is used only for numbers outside the range 10\ :sup:`m` to 10\ :sup:`n` (and only if the formatter is configured to use scientific notation at all). Use (0, 0) to include all numbers. Use (m, m) where m != 0 to fix the order of magnitude to 10\ :sup:`m`. The formatter default is :rc:`axes.formatter.limits`. useOffset : bool or float If True, the offset is calculated as needed. If False, no offset is used. If a numeric value, it sets the offset. The formatter default is :rc:`axes.formatter.useoffset`. useLocale : bool Whether to format the number using the current locale or using the C (English) locale. This affects e.g. the decimal separator. The formatter default is :rc:`axes.formatter.use_locale`. useMathText : bool Render the offset and scientific notation in mathtext. The formatter default is :rc:`axes.formatter.use_mathtext`. Raises ------ AttributeError If the current formatter is not a `.ScalarFormatter`. Nr[z*scilimits must be a sequence of 2 integersTF)sci scientificplainrN)rrrz/This method only works with the ScalarFormatter)rrrr9rrrrrrr|r  formatterset_scientificset_powerlimits set_useOffset set_useLocaleset_useMathTextAttributeError)r#rrrrrrr|nerrSTYLES is_sci_styler%r&r^axisess r'ticklabel_formatz_AxesBase.ticklabel_format! s\ eS !KKMEzz|   , 1A TEtSWX))&> ;$..*>*>*@A$!Qq1#vA;D!6!6!89;##H48 L F+JJ((77 E(JJ((88C(JJ((66yA(JJ((66yA*JJ((88E F * , !M#(+, , B L ACHK L Ls< F>F=B#G2'GF:) F55F: G GGc tjg|jd||jD]K}||dfvs |j|j }|j di||j ||Md|_y)a Control behavior of major tick locators. Because the locator is involved in autoscaling, `~.Axes.autoscale_view` is called automatically after the parameters are changed. Parameters ---------- axis : {'both', 'x', 'y'}, default: 'both' The axis on which to operate. (For 3D Axes, *axis* can also be set to 'z', and 'both' refers to all three axes.) tight : bool or None, optional Parameter passed to `~.Axes.autoscale_view`. Default is None, for no change. Other Parameters ---------------- **kwargs Remaining keyword arguments are passed to directly to the ``set_params()`` method of the locator. Supported keywords depend on the type of the locator. See for example `~.ticker.MaxNLocator.set_params` for the `.ticker.MaxNLocator` used by default for linear. Examples -------- When plotting small subplots, one might want to reduce the maximum number of ticks and use tight bounds, for example:: ax.locator_params(tight=True, nbins=4) rrrTNr.)rr{rrr set_paramsrr)r#rrr0r@rYs r'locator_paramsz_AxesBase.locator_paramso sB 6T--6v6TB$$ @Df~%nnT*<<>((,,T,?  @  r)c tjgd||dvrot|}|jdd|jdd|jdd|jdd|jj di||d vrpt|}|jd d|jd d|jd d|jd d|j j di|yy)ac Change the appearance of ticks, tick labels, and gridlines. Tick properties that are not explicitly set using the keyword arguments remain unchanged unless *reset* is True. For the current style settings, see `.Axis.get_tick_params`. Parameters ---------- axis : {'x', 'y', 'both'}, default: 'both' The axis to which the parameters are applied. which : {'major', 'minor', 'both'}, default: 'major' The group of ticks to which the parameters are applied. reset : bool, default: False Whether to reset the ticks to defaults before updating them. Other Parameters ---------------- direction : {'in', 'out', 'inout'} Puts ticks inside the Axes, outside the Axes, or both. length : float Tick length in points. width : float Tick width in points. color : :mpltype:`color` Tick color. pad : float Distance in points between tick and label. labelsize : float or str Tick label font size in points or as a string (e.g., 'large'). labelcolor : :mpltype:`color` Tick label color. labelfontfamily : str Tick label font. colors : :mpltype:`color` Tick color and label color. zorder : float Tick and label zorder. bottom, top, left, right : bool Whether to draw the respective ticks. labelbottom, labeltop, labelleft, labelright : bool Whether to draw the respective tick labels. labelrotation : float Tick label rotation grid_color : :mpltype:`color` Gridline color. grid_alpha : float Transparency of gridlines: 0 (transparent) to 1 (opaque). grid_linewidth : float Width of gridlines in points. grid_linestyle : str Any valid `.Line2D` line style spec. Examples -------- :: ax.tick_params(direction='out', length=6, width=2, colors='r', grid_color='r', grid_alpha=0.5) This will make all major ticks be red, pointing out of the box, and with dimensions 6 points by 2 points. Tick labels will also be red. Gridlines will be red and translucent. rrrrNrr r rrrrrr.)rr{rrrset_tick_paramsr)r#rr0xkwykws r'r<z_AxesBase.tick_params sD -D9 = v,C GGFD ! GGGT " GGK & GGL$ ' &DJJ & & - - = v,C GGE4 GGHd # GGJ % GGM4 ( &DJJ & & - - !r)c d|_d|_y)ar Hide all visual components of the x- and y-axis. This sets a flag to suppress drawing of all axis decorations, i.e. axis labels, axis spines, and the axis tick component (tick markers, tick labels, and grid lines). Individual visibility settings of these components are ignored as long as `set_axis_off()` is in effect. FTNrrrs r'rz_AxesBase.set_axis_off s  r)c d|_d|_y)a& Do not hide all visual components of the x- and y-axis. This reverts the effect of a prior `.set_axis_off()` call. Whether the individual axis decorations are drawn is controlled by their respective visibility settings. This is on by default. TNr rs r'rz_AxesBase.set_axis_on s  r)cN|jj}|jS)z- Get the xlabel text string. )rrr^r#rs r' get_xlabelz_AxesBase.get_xlabel    ~~r)rXc 4|||j_gd}h|h|zr|Ytd|d||ntjd}t j d|ddd d|}|j|| |jj||fi|S) a1 Set the label for the x-axis. Parameters ---------- xlabel : str The label text. labelpad : float, default: :rc:`axes.labelpad` Spacing in points from the Axes bounding box including ticks and tick labels. If None, the previous value is left as is. loc : {'left', 'center', 'right'}, default: :rc:`xaxis.labellocation` The label position. This is a high-level alternative for passing parameters *x* and *horizontalalignment*. Other Parameters ---------------- **kwargs : `~matplotlib.text.Text` properties `.Text` properties control the appearance of the label. See Also -------- text : Documents the properties supported by `.Text`. )rrhaZSpecifying 'loc' is disallowed when any of its corresponding low level keyword arguments () are also suppliedzxaxis.labellocationrVrXrrr[)rr) rlabelpadrrgrhrr{rset_label_text)r#xlabelfontdictrrYr0 protected_kwrs r' set_xlabelz_AxesBase.set_xlabel s6  "*DJJ 9 V9 &#..:^<+!,-- /3 %:;    : D A MMA3M 7(tzz((DVDDr)cl|jj|jj y)z Invert the x-axis. See Also -------- xaxis_inverted get_xlim, set_xlim get_xbound, set_xbound N)r set_inverted get_invertedrs r' invert_xaxisz_AxesBase.invert_xaxis?& DJJ$;$;$= =>r)rcB|j\}}||kr||fS||fS)z Return the lower and upper x-axis bounds, in increasing order. See Also -------- set_xbound get_xlim, set_xlim invert_xaxis, xaxis_inverted )r)r#rrs r'rz_AxesBase.get_xboundMs.mmo e %<; $; r)c |tj|r|\}}|j\}}||}||}|jt ||ft |j dy)aF Set the lower and upper numerical bounds of the x-axis. This method will honor axis inversion regardless of parameter order. It will not change the autoscaling setting (`.get_autoscalex_on()`). Parameters ---------- lower, upper : float or None The lower and upper bounds. If *None*, the respective axis bound is not modified. .. ACCEPTS: (lower: float, upper: float) See Also -------- get_xbound get_xlim, set_xlim invert_xaxis, xaxis_inverted Nreverser)rrrrrrxaxis_invertedr#rupper old_lower old_uppers r'rz_AxesBase.set_xbound]u* =R[[/ LE5#0 9 =E =E feU^%)$*=*=*?%@B  !r)c@t|jjS)a Return the x-axis view limits. Returns ------- left, right : (float, float) The current x-axis limits in data coordinates. See Also -------- .Axes.set_xlim .Axes.set_xbound, .Axes.get_xbound .Axes.invert_xaxis, .Axes.xaxis_inverted Notes ----- The x-axis may be inverted, in which case the *left* value will be greater than the *right* value. )rJrrrs r'rz_AxesBase.get_xlim(T\\++,,r)c|d||}t|tjr|j}t|tr tj |s t d|Sy)z Raise ValueError if converted limits are non-finite. Note that this function also accepts None as a limit argument. Returns ------- The limit value after call to convert(), or None if limit is None. Nz Axis limits cannot be NaN or Inf)rrndarraysqueezerrur9)r#limitrUconverted_limits r'_validate_converted_limitsz$_AxesBase._validate_converted_limitss\  %enO/2::6"1"9"9";?D1KK8 !CDD" " r))rrrrc|tj|r|\}}|| td|}|| td|}|jj ||||S)a Set the x-axis view limits. Parameters ---------- left : float, optional The left xlim in data coordinates. Passing *None* leaves the limit unchanged. The left and right xlims may also be passed as the tuple (*left*, *right*) as the first positional argument (or as the *left* keyword argument). .. ACCEPTS: (left: float, right: float) right : float, optional The right xlim in data coordinates. Passing *None* leaves the limit unchanged. emit : bool, default: True Whether to notify observers of limit change. auto : bool or None, default: False Whether to turn on autoscaling of the x-axis. True turns on, False turns off, None leaves unchanged. xmin, xmax : float, optional They are equivalent to left and right respectively, and it is an error to pass both *xmin* and *left* or *xmax* and *right*. Returns ------- left, right : (float, float) The new x-axis limits in data coordinates. See Also -------- get_xlim set_xbound, get_xbound invert_xaxis, xaxis_inverted Notes ----- The *left* value may be greater than the *right* value, in which case the x-axis values will decrease from left to right. Examples -------- >>> set_xlim(left, right) >>> set_xlim((left, right)) >>> left, right = set_xlim(left, right) One limit may be left unchanged. >>> set_xlim(right=right_lim) Limits may be passed in reverse order to flip the direction of the x-axis. For example, suppose *x* represents the number of years before present. The x-axis limits might be set like the following so 5000 years ago is on the left of the plot and the present is on the right. >>> set_xlim(5000, 0) z"Cannot pass both 'left' and 'xmin'z#Cannot pass both 'right' and 'xmax'r)rrrrr#)r#rrrrrrs r'rz_AxesBase.set_xlimsvD =R[[.KD%   DEED    EFFEzz""4T"EEr) get_scale_set_axes_scale get_ticklocs set_ticks set_xticksrget_majorticklabelsget_minorticklabelsget_ticklabelsset_ticklabelszAxis.set_tickszAxes.set_xtickscN|jj}|jS)z- Get the ylabel text string. )rrr^r s r' get_ylabelz_AxesBase.get_ylabelrr)c :|||j_gd}h|h|zr|\td|d||ntjd}t j d|ddd d|\}}|j|| |jj||fi|S) a1 Set the label for the y-axis. Parameters ---------- ylabel : str The label text. labelpad : float, default: :rc:`axes.labelpad` Spacing in points from the Axes bounding box including ticks and tick labels. If None, the previous value is left as is. loc : {'bottom', 'center', 'top'}, default: :rc:`yaxis.labellocation` The label position. This is a high-level alternative for passing parameters *y* and *horizontalalignment*. Other Parameters ---------------- **kwargs : `~matplotlib.text.Text` properties `.Text` properties control the appearance of the label. See Also -------- text : Documents the properties supported by `.Text`. )rrrrrzyaxis.labellocation)rrWrrX)rr)rrW)r[r)rr) rrrrgrhrr{rr) r#ylabelrrrYr0rrrs r' set_ylabelz_AxesBase.set_ylabel s6  "*DJJ 9 V9 &#..:^<+!,-- /3 %:;    : D&)# EAr MMA2M 6(tzz((DVDDr)cl|jj|jj y)z Invert the y-axis. See Also -------- yaxis_inverted get_ylim, set_ylim get_ybound, set_ybound N)rrrrs r' invert_yaxisz_AxesBase.invert_yaxis<rr)cB|j\}}||kr||fS||fS)z Return the lower and upper y-axis bounds, in increasing order. See Also -------- set_ybound get_ylim, set_ylim invert_yaxis, yaxis_inverted )r)r#rrs r'rz_AxesBase.get_yboundJs.mmo  C<3; ; r)c |tj|r|\}}|j\}}||}||}|jt ||ft |j dy)aC Set the lower and upper numerical bounds of the y-axis. This method will honor axis inversion regardless of parameter order. It will not change the autoscaling setting (`.get_autoscaley_on()`). Parameters ---------- lower, upper : float or None The lower and upper bounds. If *None*, the respective axis bound is not modified. .. ACCEPTS: (lower: float, upper: float) See Also -------- get_ybound get_ylim, set_ylim invert_yaxis, yaxis_inverted Nr!r)rrrrrryaxis_invertedr$s r'rz_AxesBase.set_yboundZr(r)c@t|jjS)a Return the y-axis view limits. Returns ------- bottom, top : (float, float) The current y-axis limits in data coordinates. See Also -------- .Axes.set_ylim .Axes.set_ybound, .Axes.get_ybound .Axes.invert_yaxis, .Axes.yaxis_inverted Notes ----- The y-axis may be inverted, in which case the *bottom* value will be greater than the *top* value. )rJrrrs r'rz_AxesBase.get_ylim|r*r))rrrrc|tj|r|\}}|| td|}|| td|}|jj ||||S)a Set the y-axis view limits. Parameters ---------- bottom : float, optional The bottom ylim in data coordinates. Passing *None* leaves the limit unchanged. The bottom and top ylims may also be passed as the tuple (*bottom*, *top*) as the first positional argument (or as the *bottom* keyword argument). .. ACCEPTS: (bottom: float, top: float) top : float, optional The top ylim in data coordinates. Passing *None* leaves the limit unchanged. emit : bool, default: True Whether to notify observers of limit change. auto : bool or None, default: False Whether to turn on autoscaling of the y-axis. *True* turns on, *False* turns off, *None* leaves unchanged. ymin, ymax : float, optional They are equivalent to bottom and top respectively, and it is an error to pass both *ymin* and *bottom* or *ymax* and *top*. Returns ------- bottom, top : (float, float) The new y-axis limits in data coordinates. See Also -------- get_ylim set_ybound, get_ybound invert_yaxis, yaxis_inverted Notes ----- The *bottom* value may be greater than the *top* value, in which case the y-axis values will decrease from *bottom* to *top*. Examples -------- >>> set_ylim(bottom, top) >>> set_ylim((bottom, top)) >>> bottom, top = set_ylim(bottom, top) One limit may be left unchanged. >>> set_ylim(top=top_lim) Limits may be passed in reverse order to flip the direction of the y-axis. For example, suppose ``y`` represents depth of the ocean in m. The y-axis limits might be set like the following so 5000 m depth is at the bottom of the plot and the surface, 0 m, is at the top. >>> set_ylim(5000, 0) z$Cannot pass both 'bottom' and 'ymin'z!Cannot pass both 'top' and 'ymax'r)rrrrr#)r#rrrrrrs r'rz_AxesBase.set_ylimsuD ;2;;v. KFC  ! FGGF   CDDCzz""63T"EEr) set_ytickszAxes.set_yticks axis_datec|j|j|S|jjj|S)z Return *x* formatted as an x-value. This function will use the `.fmt_xdata` attribute if it is not None, else will fall back on the xaxis major formatter. )r2rget_major_formatterformat_data_short)r#rs r' format_xdataz_AxesBase.format_xdataJH$.."<IJL LZZ335GGL Lr)c|j|j|S|jjj|S)z Return *y* formatted as a y-value. This function will use the `.fmt_ydata` attribute if it is not None, else will fall back on the yaxis major formatter. )r3rrJrK)r#rs r' format_ydataz_AxesBase.format_ydatarMr)c V|jj|}t|dk(r >(,(9(9!(<> >NN,,aV4 Jx$89 UB\\224>>yINFF NN!!"//&"92??6;RS U U##EJJw$788r)cl|jj|jjy)z Display minor ticks on the Axes. Displaying minor ticks may reduce performance; you may turn them off using `minorticks_off()` if drawing speed is a problem. N)r minorticks_onrrs r'rXz_AxesBase.minorticks_ons$   "   "r)cl|jj|jjy)z!Remove minor ticks from the Axes.N)rminorticks_offrrs r'rZz_AxesBase.minorticks_offs" !!# !!#r)cy)zV Return whether this Axes supports the zoom box button functionality. Tr.rs r'can_zoomz_AxesBase.can_zoom%r)cy)zV Return whether this Axes supports any pan/zoom button functionality. Tr.rs r'can_panz_AxesBase.can_pan+r]r)c|jS)zG Get whether the Axes responds to navigation commands.  _navigaters r' get_navigatez_AxesBase.get_navigate1s~~r)c||_y)z Set whether the Axes responds to navigation toolbar commands. Parameters ---------- b : bool See Also -------- matplotlib.axes.Axes.set_forward_navigation_events Nrarrs r'r4z_AxesBase.set_navigate7s r)c|jS)zS Get the navigation toolbar button status: 'PAN', 'ZOOM', or None. _navigate_moders r'get_navigate_modez_AxesBase.get_navigate_modeFs"""r)c||_y)z Set the navigation toolbar button status. .. warning:: This is not a user-API function. Nrfrrs r'r5z_AxesBase.set_navigate_modeLs  r)c|j|j|j|jdS)a Save information required to reproduce the current view. This method is called before a view is changed, such as during a pan or zoom initiated by the user. It returns an opaque object that describes the current view, in a format compatible with :meth:`_set_view`. The default implementation saves the view limits and autoscaling state. Subclasses may override this as needed, as long as :meth:`_set_view` is also adjusted accordingly. )r autoscalex_onr autoscaley_on)rrrrrs r' _get_viewz_AxesBase._get_viewVs6MMOd6L6L6NMMOd6L6L6N  r)c(|jdi|y)a7 Apply a previously saved view. This method is called when restoring a view (with the return value of :meth:`_get_view` as argument), such as with the navigation buttons. Subclasses that override :meth:`_get_view` also need to override this method accordingly. Nr.)r)r#views r' _set_viewz_AxesBase._set_viewgs 4r)ct|dk(r|\}}}|dk(rd}|dkDrd}nd}d|z }|jjtj|j |j g\\} } \} } | | z } | | z }| | zdz}| | zdz}||dz z|z|z }||dz z|z|z }|| dz |z z ||dz |z z || dz |z z||dz |z zg}n$t|d k7rtjd y |j\}}|j\}}|\}}}}|jjj||f||fg\\}}\}}tjt||g||\} } tjt||g||\} } |s|d k(r||} } |s|d k(r||} } |dk(r | | f}| | f}||fS|dk(r|jj}|j||| | g\}}} }!||z |!| z z }"||"| |z zz }#||"||!z zz}$|jj|#|$g}|j j}%|%j||| | g\}&}'}(})|'|&z |)|(z z }"|&|"|(|&z zz }*|'|"|'|)z zz}+|%jj|*|+g}fS)z Helper function to prepare the new bounds from a bbox. This helper function returns the new x and y bounds from the zoom bbox. This a convenience method to abstract the bbox logic out of the base setter. rrrr[inoutrrrzgWarning in _set_view_from_bbox: bounding box is not a tuple of length 3 or 4. Ignoring the view change.Nrr)r`rrHr transposerrrrrrrcliprrrr),r#rk directionmodetwinxtwinyxpypsclrrrrxwidthywidthxcenycenxzcyzcxmin0xmax0ymin0ymax0startxstartystopxstopy new_xbound new_yboundrsxmin0sxmax0sxminsxmaxfactorsxmin1sxmax1rsymin0symax0syminsymaxsymin1symax1s, r'_prepare_view_from_bboxz!_AxesBase._prepare_view_from_bboxsse t9>KBCaxQw ! e)-)A)A dmmot}}?@*B <4,4D[FD[F4K#D4K#DsQw<$&+CsQw<$&+C&)C-'vby})<&)C-'vby})<>D Y!^   > ? ( u( u'+$u+/>>+B+B+D+N+Nf u~ .,0(.5%WWVVUO4eUC dWWVVUO4eUC d DCK$D DCK$D  tJtJ,:%%)% JJ,,.E+0??tT*,, (FFE5vo%%-8Ff77Ff77F)33VV4DEJJJ,,.E+0??tT*,, (FFE5vo%%-8Ff77Ff77F)33VV4DEJ:%%r)c|j|||||\}}|s'|dk7r"|j||jd|s)|dk7r#|j||j dyyy)a Update view from a selection bbox. .. note:: Intended to be overridden by new projection types, but if not, the default implementation sets the view limits to the bbox directly. Parameters ---------- bbox : 4-tuple or 3 tuple * If bbox is a 4 tuple, it is the selected bounding box limits, in *display* coordinates. * If bbox is a 3 tuple, it is an (xp, yp, scl) triple, where (xp, yp) is the center of zooming and scl the scale factor to zoom by. direction : str The direction to apply the bounding box. * `'in'` - The bounding box describes the view directly, i.e., it zooms in. * `'out'` - The bounding box describes the size to make the existing view, i.e., it zooms out. mode : str or None The selection mode, whether to apply the bounding box in only the `'x'` direction, `'y'` direction or both (`None`). twinx : bool Whether this axis is twinned in the *x*-direction. twiny : bool Whether this axis is twinned in the *y*-direction. )rvrwrxryrFrN)rrrrr)r#rkrvrwrxryrrs r'_set_view_from_bboxz_AxesBase._set_view_from_bboxsxH"&!=!= IDU">"L J OOJ '  " "5 ) OOJ '  " "5 )%ur)c tj|jj|jj|jj j|j j|||_y)aQ Called when a pan operation has started. Parameters ---------- x, y : float The mouse coordinates in display coords. button : `.MouseButton` The pressed mouse button. Notes ----- This is intended to be overridden by new projection types. )rr trans_inverserkrrN)typesSimpleNamespacerrrrrk _pan_start)r#rrbuttons r' start_panz_AxesBase.start_panse // ##%..'')..113::<!!# r)c|`y)z Called when a pan operation completes (when the mouse button is up.) Notes ----- This is intended to be overridden by new projection types. N)rrs r'end_panz_AxesBase.end_pans  Or)cd}|j}||jz }||jz }||cxk(rdk(ry|dk(rF||||\}}|jj | | j |j } n|dk(r | |jjz }| |jjz }||||\}}|jdk7r d||zzx}}tjd||f} tj|j|jg} |jj |j} | | | | z zz} tj | j |j } nytj(| j |j}| j+j-t.}d||<|S#t"$rt%j&d YywxYw) z Helper function to return the new points after a pan. This helper function returns the points on the axis after a pan has occurred. This is a convenience method to abstract the pan logic out of the base setter. c|dk(r#t|t|kDr|}||fS|}||fS|dk(rd}||fS|dk(rd}||fS|dk(rdt|zt|krd}||fSdt|zt|krd}||fSt|t|kDr|t|z t|z}||fS|t|z t|z}||fS)NcontrolrrrshiftrZ)r)rFdxdys r' format_deltasz0_AxesBase._get_pan_points..format_deltassir7SW$B r6MBr6Mr6Mr6Ms2w;R(Br6M R[3r7*B r6M Ws2w&c"gB/Br6Mc"gB/Br6Mr)rNr[rrrg$@zOverflow while panning)rrrrk translatedrrrrrprpowerrrrrLrN OverflowErrorrrrur astyperL)r#rrFrrrr4rrralphastart oldpoints newpointsvalidrs r'_get_pan_pointsz_AxesBase._get_pan_pointss * OO W W =q=   Q;"3B/FBVV&&sRC0<$?? %**95&;q7  F..qww78""$++F3v ! ""#;< s C?G''HHc|j||||}|1|j|dddf|j|dddfyy)a Called when the mouse moves during a pan operation. Parameters ---------- button : `.MouseButton` The pressed mouse button. key : str or None The pressed key, if any. x, y : float The mouse coordinates in display coords. Notes ----- This is intended to be overridden by new projection types. Nrr[)rrr)r#rrFrrrs r'drag_panz_AxesBase.drag_panOsM"%%fc1a8   MM&A, ' MM&A, ' r)c4g|j|jj|jj|j|j |j |j|j |jgng|jSr-) r&rr|rrarrrrrrs r'rz_AxesBase.get_childrenes ^^ [[   ! ^^ " " $  JJ  ((  +/*;*;  __  !% 8t||nb   JJ  r)c8|jj|Sr-rbrds r'rcz_AxesBase.containsqszz"":..r)c<|jj|dS)zf Return whether *point* (pair of pixel coordinates) is inside the Axes patch. r)radius)rcontains_point)r#points r'rz_AxesBase.contains_pointus zz((s(;;r)c|j}|jjD]}|j||jr |j s0|j jD]}|j||j|j|j|j|j|jttjtjtjf}|Dcgc]B}|j!s|j#s%t%||s|j's|Dc}Scc}w)z Return a default list of artists that are used for the bounding box calculation. Artists are excluded either by not being visible or ``artist.set_in_layout(False)``. )rrr|rrr.rrarrrrrr AnnotationBbox OffsetBoxr get_in_layoutr_fully_clipped_to_axes)r#rRrr'nocliprs r'get_default_bbox_extra_artistsz(_AxesBase.get_default_bbox_extra_artists|s##%NN))+ !D NN4  !  ++- &u% & tzz"t''(t(() UZZ**I,?,?A"Oaammo!//:K6*!2J2J2LO OOsE(E9 E)call_axes_locatorbbox_extra_artistsfor_layout_onlycg}| |jdj}|jsy|j}|j |r |r |||nd|j j D]J}|js|js!tj||}|s:|j|L|j||j|} |j| |j|j|jfD]~} | js| j|} |rG| j dkDr8| j"| j$zdz dz | _| j"dz| _|j| |} | |j'} | D]u} | j)|}|d|j cxkrt*j,ks;n>d|j.cxkrt*j,ksbne|j|wt0j2j5|Dcgc]#}|j dk7s|j.dk7s"|%c}Scc}w)a Return the tight bounding box of the Axes, including axis and their decorators (xlabel, title, etc). Artists that have ``artist.set_in_layout(False)`` are not included in the bbox. Parameters ---------- renderer : `.RendererBase` subclass renderer that will be used to draw the figures (i.e. ``fig.canvas.get_renderer()``) bbox_extra_artists : list of `.Artist` or ``None`` List of artists to include in the tight bounding box. If ``None`` (default), then all artist children of the Axes are included in the tight bounding box. call_axes_locator : bool, default: True If *call_axes_locator* is ``False``, it does not call the ``_axes_locator`` attribute, which is necessary to get the correct bounding box. ``call_axes_locator=False`` can be used if the caller is only interested in the relative size of the tightbbox compared to the Axes bbox. for_layout_only : default: False The bounding box will *not* include the x-extent of the title and the xlabel, or the y-extent of the ylabel. Returns ------- `.BboxBase` Bounding box in figure pixel coordinates. See Also -------- matplotlib.axes.Axes.get_window_extent matplotlib.axis.Axis.get_tightbbox matplotlib.spines.Spine.get_window_extent NTrJrrZrr)rP _get_rendererrrrrr|rr_get_tightbbox_for_layout_onlyr rrlrarrrrrrrrrrrLrNunion)r#rSrrrrrrbaaxbboxrabt bbox_artistsrrkrns r'rz_AxesBase.get_tightbboxsV  D1??AH!'') '.3DGD( #$ PNN))+ "D{{t//1;;D(KIIbM  " ##H-''1 &jj$"2"2D4E4EF E  ",,X6"rxx!| UURUU]a/#5BEEECKBE "  *  >>@L A??8,D DJJ//DKK0"&&0 $  %% <1agglahh!mQ <> > .is@s""$@rk)rdrr'ri _subplot_spec)r#rs r''_get_subplotspec_with_optional_colorbarz1_AxesBase._get_subplotspec_with_optional_colorbarbs;  ! ! # @@ @"00B r))rc4|r/t|jtjjsy|j }|y|j j}|js|dk(r|jd|rddini}|j jd ddd||j jjddk(r%|j jjd|js|dk(r|jd|rddini}|j jd ddd||j jjdd k(r&|j jjdyyy) NrrFr)r rr[r)r rrr.)rrrgrbrrrr is_first_rowrrrrgr! is_last_row)r#rrrlabel_positiontop_kw bottom_kws r'rz_AxesBase._label_outer_xaxismsj %Z 8; 8M8M.O   9 9 ; : 668 &#'9eU^rF &DJJ & & 8u 806 8zz$$113A6!; %%11%8~~)#-?5)RI &DJJ & & >% >3< >zz$$113A6!; %%11%8<  r)c4|r/t|jtjjsy|j }|y|j j}|js|dk(r|jd|rddini}|j jd ddd||j jjddk(r%|j jjd|js|dk(r|jd|rddini}|j jd ddd||j jjdd k(r&|j jjdyyy) NrrFr)r r rr)r r r[r.)rrrgrbrrrr is_first_colr?rrrgr! is_last_col)r#rrrrleft_kwright_kws r'rz_AxesBase._label_outer_yaxissj %Z 8; 8M8M.O   9 9 ; : 668 '#);vuoG &DJJ & & : :18 :zz$$113A6!; %%11%8~~(#+='2H &DJJ & & < <2: <zz$$113A6!; %%11%8<  r)c||_y)a Set how pan/zoom events are forwarded to Axes below this one. Parameters ---------- forward : bool or "auto" Possible values: - True: Forward events to other axes with lower or equal zorder. - False: Events are only executed on this axes. - "auto": Default behaviour (*True* for axes with an invisible patch and *False* otherwise) See Also -------- matplotlib.axes.Axes.set_navigate Nr)r#forwards r'set_forward_navigation_eventsz'_AxesBase.set_forward_navigation_eventss &+2'r)c|jS)z=Get how pan/zoom events are forwarded to Axes below this one.rrs r'get_forward_navigation_eventsz'_AxesBase.get_forward_navigation_eventss...r)r-)rN)rF)r)Nrinches)NNF)T)TTrP)TrN)NTT)Nr r)rN)rrNFF)r5r4r6r@rr GrouperrIrJrCrLrN__annotations__r(r)rrnrppropertyrrr(rErKrSrbrdr"rirlr,r!rrrrwrrrrrrrrgrrfrrrrrr+rrr0r1rArrIrRr[r^r`rbrdrfrhrrr|rpr|r~rvrr$rrwrrrrrrrrrget_xgridlinesget_xticklinesget_ygridlinesget_yticklinesrrrrrrrrrr"rr6r5rErHr;rNrrrfrrrrrlrrpsetterrtrwr}rrrrrr}rrallow_rasterizationrrrrrrr/r interpdrrrr<rrrrrr#rrrr0rrr6 get_xticksr6get_xmajorticklabelsget_xminorticklabelsget_xticklabelsset_xticklabelsr<r?rArDrrrrrr7 get_yticksrGget_ymajorticklabelsget_yminorticklabelsget_yticklabelsset_yticklabels xaxis_date yaxis_daterLrOrVrXrZr\r_rcr4rhr5rmrprrrrrrrrcrrrrrxryrrrrrrrr __classcell__)rr@r r?s000@r'rr%s) DK6ABBdD%--/)BL!EMMOM   H NN ;;  ;; .. 8   +1fP , I"!R O 4 ' K  *",HD8%6(6D8'6&6I +0"8 1 " '8"@$/&/&BHC"XC"J'' ==MMIILLIIFF* / &J>XFP  /b #J ,\ bBHHHT;7  *'?CN)'?CN)'?CN)'?CN !# ,,&(T ?" .1` &CP   06412;1;1z2 -W6IJ,W6IJ,W6IJ,W6IJ8 &&& ))  ,,#'$dP d(*+;Z~)@D*N   D!DLA H  %N(<(BN !D-,#&LFdLF\&g{;J%g/@AJ%g~>J%g{/:L.IKJ/9NO/9NO*74DEO*!!#457O 1E1Ef ?*'>BN !D-,LFdLF\&g{;J%g/@AJ%g~>J%g{/:L.IKJ/9NO/9NO*74DEO*!!#457O&g{;J%g{;JLL9"#$   #   " 7;>CN&`37:?+*Z.<|(,  /<O@U>)-uU>n,><99G( /498/4962*/ODCsQrcFGdd}|||j|S)a A helper function for rasterizing the list of artists. The bookkeeping to track if we are or are not in rasterizing mode with the mixed-mode backends is relatively complicated and is now handled in the matplotlib.artist.allow_rasterization decorator. This helper defines the absolute minimum methods and attributes on a shim class to be compatible with that decorator and then uses it to rasterize the list of artists. This is maybe too-clever, but allows us to reuse the same code that is used on normal artists to participate in the "are we rasterizing" accounting. Please do not use this outside of the "rasterize below a given zorder" functionality of Axes. Parameters ---------- figure : matplotlib.figure.Figure The figure all of the artists belong to (not checked). We need this because we can at the figure level suppress composition and insert each rasterized artist as its own image. artists : List[matplotlib.artist.Artist] The list of Artists to be rasterized. These are assumed to all be in the same Figure. renderer : matplotlib.backendbases.RendererBase The currently active renderer Returns ------- None cJeZdZdZdZdZddZejdZ y)(_draw_rasterized.._MinimalArtistcy)NTr.rs r'get_rasterizedz7_draw_rasterized.._MinimalArtist.get_rasterizedr)cyr-r.rs r'get_agg_filterz7_draw_rasterized.._MinimalArtist.get_agg_filterr#r)c ||_||_yr-)figurerR)r#r'rRs r'r(z1_draw_rasterized.._MinimalArtist.__init__s DK"DLr)cV|r|jjdS|jS)NTrJ)r'rP)r#rKs r'rPz3_draw_rasterized.._MinimalArtist.get_figures'{{--4-88{{"r)cH|jD]}|j|yr-)rRr)r#rSrs r'rz-_draw_rasterized.._MinimalArtist.draws!\\ !x  !r)Nr) r5r4r6r"r%r(rPrrrr.r)r'_MinimalArtistr s0   # #  $ $ ! % !r)r*)r)r'rRrSr*s r'rrs'L!!, &' * / / 99r))Pcollections.abcrr contextlibrrrloggingnumbersroperatorrrernumpyr matplotlibrgrr r r matplotlib.artistr6rmatplotlib.axisrrmatplotlib.cbookr r rmatplotlib.collectionsr[rSmatplotlib.colorscolorsr^matplotlib.font_managerrmatplotlib.gridspecrmatplotlib.imagerrUmatplotlib.linesr`ramatplotlib.patchesrbrmatplotlib.rcsetuprrmatplotlib.spinesrr(matplotlib.tabletablerXmatplotlib.textrrmatplotlib.tickertickerrmatplotlib.transforms transformsrL getLoggerr5rrrCrqrsdefine_aliasesArtistrrr.r)r'rIs.  99#==&#.+!!%9#!#+w":&:&zHH28=P$fV*V*r kD6*+TB/TB/,TB/nD<:r)