rL i dZddlZddlZddlZddlmZddlZddlZddl Z ddl m Z m Z ddl mZddlmZddlmZddlmZddlmZddlmZddlm Z!ddl"m#Z$ejJe&Z'dZ(ejRejTZ+e+jYZ-e+j\j_Dcgc]}e0e1|c}Z2e-e2zDcgc]}d|z c}Z3GddejhZ5Gd d e5Z6Gd d e5Z7Gd dZ8GddZ9GddejhZ:dZ;Gdde:Z<Gdde:Z=ycc}wcc}w)z* Classes for the ticks and x- and y-axis. N)Real)_apicbookgrid_ceZdZdZdddddddddddddddddddddfd ZdZed Zd Zd Z d Z d Z dfd Z dZ dZdZdZej$dZfdZdZdZdZdZdZdZxZS)Ticka Abstract base class for the axis ticks, grid lines and labels. Ticks mark a position on an Axis. They contain two lines as markers and two labels; one each for the bottom and top positions (in case of an `.XAxis`) or for the left and right positions (in case of a `.YAxis`). Attributes ---------- tick1line : `~matplotlib.lines.Line2D` The left/bottom tick marker. tick2line : `~matplotlib.lines.Line2D` The right/top tick marker. gridline : `~matplotlib.lines.Line2D` The grid line associated with the label position. label1 : `~matplotlib.text.Text` The left/bottom tick label. label2 : `~matplotlib.text.Text` The right/top tick label. NTFr)sizewidthcolortickdirpad labelsize labelcolorlabelfontfamilyzordergridOntick1Ontick2Onlabel1Onlabel2Onmajor labelrotation grid_colorgrid_linestylegrid_linewidth grid_alphac t|| Itjd}|r|dvrtjd} n|s|dvrtjd} nd} |j |j d||_||_||_|j}|rdnd }|tj|d |d }||_ |tj|d |d }||_ |tj|d }|tj|d |d}||_ | tj|d} tj| drtj|d } |tj|d}|j|| :|rt j"j$dz} nt j"j$} | |_tj(|d}tj(|d}tj(|d}|(t+j,|stjd}|j/Dcic] \}}|dd| }}}t!j"gg|d| | ||| |_t!j"gg|d| |||| |_t!j"ggf||| ||dd||_t6|j4j9_t=j>t@jBt@jB|| || |jDd|_#t=j>t@jBt@jB|| || |jDd|_$|jK||j0|j2|j4|jF|jHfD]}|jM||jO|ycc}}w)z bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points Naxes.grid.whichbothr axes.gridr!minorFrootrr$.z.sizez.widthz.colorz.padz .labelcolorinheritz .labelsizeg{Gz?z grid.colorzgrid.linestylezgrid.linewidthz grid.alphanone)r linestylervisiblemarkeredgecolor markersizemarkeredgewidth)r alphar,r+ linewidthmarker)fontsizer r, fontfamilyrotation)(super__init__mplrcParams set_figure get_figureaxes_loc_major__name___size_width _base_padr _str_equal_set_labelrotationmlinesLine2Dr_zorder _val_or_rcmcolors_has_alpha_channelitems tick1line tick2linegridlineGRIDLINE_INTERPOLATION_STEPSget_path_interpolation_stepsmtextTextnpnan_labelrotationlabel1label2_apply_tickdir_set_artist_propsupdate_position) selfr>locr r r r rrrrrrrrrrrrrrrrkwargswhichname major_minorkvgrid_kwartist __class__s U/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/axis.pyr9z Tick.__init__;s:  >LL!23E%#44k2%+<"<k2 U34   }}!&gG <<<4&+e <=D =LLD6;-v!>?E =LLD61E ;,,$q T:;C  k&:;J   J 2fo6J   vZ%89I  . >--4-- ^^J = 8HI8HI  g&@&@&L l3J(. 711QR5!877 6&'!dE    6&'!dE    J$r     )  5jj FFBFFj(&1D1DQ1GI jj FFBFFj(&1D1DQ1GI G$~~t~~t}}{{DKK1 +F  " "6 * + S!G8sO5ct|tr|}d}n t|ttfr|\}}nd}|}t j ddg|||f|_y)Nrdefaultauto)r) isinstancestrtuplelistr check_in_listrX)r^rmodeangles rirFzTick._set_labelrotationsX mS ) DE  t} 5'KD%D!E FI.dC#Umc<|j|jzSN)rDget_tick_paddingr^s ri_padz Tick._pads~~ 5 5 777rtc|(tj|jd}||_ytjgd|||_y)z;Set tick direction. Valid values are 'out', 'in', 'inout'.Nz .direction)inoutinout)r )r:r;rArrq_tickdir)r^r s rir[zTick._apply_tickdirsE ?lldmm_J#?@G     5w G rtc|jSrv)r~rxs ri get_tickdirzTick.get_tickdirs }}rtcFdddd}|j||jzS)z/Get the length of the tick outside of the Axes.g??)r{r}r|)rBr~)r^paddings rirwzTick.get_tick_paddings.  zzGDMM222rtcx|j|j|j|j|jg}|Srv)rNrOrPrYrZ)r^childrens ri get_childrenzTick.get_childrens.NNDNNMM4;; =rtclt||||jj||d|_yNT)r8 set_clip_pathrPstale)r^path transformrhs rirzTick.set_clip_paths- dI. ##D)4 rtc difS)z Test whether the mouse event occurred in the Tick marks. This function always returns false. It is more useful to test if the axis as a whole contains the mouse rather than the set of tick marks. F)r^ mouseevents ricontainsz Tick.containssbyrtc6|j|d|_y)zm Set the tick label pad in points Parameters ---------- val : float )rTN) _apply_paramsrr^vals riset_padz Tick.set_pads s# rtc|jS)z.Get the value of the tick label pad in points.)rDrxs riget_padz Tick.get_pads ~~rtc|jS)z3Return the tick location (data coords) as a scalar.)r?rxs riget_locz Tick.get_locs yyrtcl|jsd|_y|j|j|j |j |j |j|j|jfD]}|j||j|jd|_y)NFgid) get_visibler open_grouprAget_gidrPrNrOrYrZdraw close_group)r^rendererrgs rirz Tick.draw s!DJ DMMt||~>}}dnndnn{{DKK1 "F KK ! " T]]+ rtct|||jj||jj|d|_y)zl Set the url of label1 and label2. Parameters ---------- url : str TN)r8set_urlrYrZr)r^urlrhs rirz Tick.set_urls<  C  C  rtcF|j|jdyNFr%r<r=r^as rir\zTick._set_artist_props%s T__%_01rtctd)zX Return the view limits ``(min, max)`` of the axis the tick belongs to. Derived must overrideNotImplementedErrorrxs riget_view_intervalzTick.get_view_interval(s""9::rtc d|jfd|jfd|jfd|jfd|jffD]*\}}|vs |j j |,tfddDr=j d|j|_j d |j|_ j d |j|_ |jj d |j|j|jfD]8}|j|j|j|j:|jd }|jj!||j#d }|jj!|j%Dcic] \}}|d vs ||}}}dvrd|d<|jj&di||jj&di||j%D]\}}t)|d|z|dvrr|j+j d|jj'|j,d|jj'|j,dj%Dcic]\}}|dvr|dd|} }}|jj&di| |jj&di| j%Dcic]\}}|t.vr|dd|} }}|jj&di| ycc}}wcc}}wcc}}w)Nrrrrrc3&K|]}|v ywrvr).0rdr`s ri z%Tick._apply_params..6sHqqF{Hs)r r rr r r rr r)r rr r-_rr4)r7)rrrr)r)rPrNrOrYrZ set_visiblepopanyrBrCrDr[r~set_markersizeset_markeredgewidth_get_text1_transform set_transform_get_text2_transformrMsetsetattrrFrX_gridline_param_names) r^r`rbtargetlinetransrdretick_kwlabel_kwrfs ` rirzTick._apply_params.s-& 6'8'8($++6($++6 8 5LD& v~""6::d#34  5 H$GH HFDJJ7DJ!**Wdkk:DK#ZZt~~>DN    9dmm D E8 6##DJJ/((5 6--/2E KK % %e ,--/2E KK % %e ,$*LLNODAqa;N6N1a4OO f )/G% &%W%%W%MMO &DAq D#'1 % & f $  # #FJJ$? @ KKOOT%8%8%;O < KKOOT%8%8%;O <)/LAJJabE1HLL #(# #(#(. 2100QR5!822 $G$)PL 2s M;$M;!NNctd):Set the location of tick in data coords with scalar *loc*.rrr^r_s rir]zTick.update_position]!"9::rtctdNrrrxs rirzTick._get_text1_transforma!"9::rtctdrrrxs rirzTick._get_text2_transformdrrtrv)rA __module__ __qualname____doc__r9rFpropertyryr[rrwrrrrrrmartistallow_rasterizationrrr\rrr]rr __classcell__rhs@rir r %s. +@"D ,88  3       !  2; -%^;;;rtr cHeZdZdZdZfdZdZdZfdZdZdZ xZ S) XTickzq Contains all the Artists needed to make an x tick - the tick line, the label text and the grid line xtickc0t||i||j}|jj dgdgf|j d|j j dgdgf|j d|jj ddgddgf|j d|j\}}}|jj dd||||j\}}}|jj dd|||yNrtick1)datarr4tick2gridxyverticalalignmenthorizontalalignmentr) r8r9r>rNrget_xaxis_transformrOrPrrYrrZr^argsr`axrvaharhs rir9zXTick.__init__o! $)&) YY #sr'='=g'F  H #sr'='=g'F  H a&1a&!R-C-CF-K  M113 r2 1 bE  113 r2 1 bE  rtcL|jj|jSrv)r>get_xaxis_text1_transformryrxs rirzXTick._get_text1_transformyy22499==rtcL|jj|jSrv)r>get_xaxis_text2_transformryrxs rirzXTick._get_text2_transformrrtc4t||tjtjftjtjfdd|j \}}|j j||jj|y)N)|rr|r{r}) r8r[rGTICKDOWNTICKUPr~rN set_markerrOr^r mark1mark2rhs rir[zXTick._apply_tickdirsr w'OOV]]3==&//2  --  u !!%( !!%(rtc4|jj|f|jj|f|jj|f|jj ||j j |||_d|_yrTN) rN set_xdatarOrPrYset_xrZr?rrs rir]zXTick.update_positionp   #(   #( ' # #  rtcB|jjjSrv)r>viewLim intervalxrxs rirzXTick.get_view_intervalyy  ***rt rArrrr9rrr[r]rrrs@rirrh-H ,>> )+rtrcHeZdZdZdZfdZdZdZfdZdZdZ xZ S) YTickzp Contains all the Artists needed to make a Y tick - the tick line, the label text and the grid line ytickc0t||i||j}|jj dgdgf|j d|j j dgdgf|j d|jj ddgddgf|j d|j\}}}|jj dd||||j\}}}|jj dd|||yr) r8r9r>rNrget_yaxis_transformrOrPrrYrrZrs rir9zYTick.__init__rrtcL|jj|jSrv)r>get_yaxis_text1_transformryrxs rirzYTick._get_text1_transformrrtcL|jj|jSrv)r>get_yaxis_text2_transformryrxs rirzYTick._get_text2_transformrrtc4t||tjtjftjtjfdd|j \}}|j j||jj|y)N)rrr) r8r[rGTICKLEFT TICKRIGHTr~rNrrOrs rir[zYTick._apply_tickdirsv w'OOV%5%56##V__5  --  u !!%( !!%(rtc4|jj|f|jj|f|jj|f|jj ||j j |||_d|_yr) rN set_ydatarOrPrYset_yrZr?rrs rir]zYTick.update_positionrrtcB|jjjSrv)r>r intervalyrxs rirzYTick.get_view_intervalrrtrrs@rirrrrtrc~eZdZdZdZedZejdZedZejdZy)Tickera4 A container for the objects defining tick position and format. Attributes ---------- locator : `~matplotlib.ticker.Locator` subclass Determines the positions of the ticks. formatter : `~matplotlib.ticker.Formatter` subclass Determines the format of the tick labels. c<d|_d|_d|_d|_yr)_locator _formatter_locator_is_default_formatter_is_defaultrxs rir9zTicker.__init__s  #' %)"rtc|jSrv)rrxs rilocatorzTicker.locators }}rtc\t|tjs td||_y)Nz7locator must be a subclass of matplotlib.ticker.Locator)rmmtickerLocator TypeErrorrr^rs rirzTicker.locators)'7??389 9 rtc|jSrv)rrxs ri formatterzTicker.formatter rtc\t|tjs td||_y)Nz;formatter must be a subclass of matplotlib.ticker.Formatter)rmr Formatterr!rr^r$s rir$zTicker.formatters+)W%6%67:; ;#rtN) rArrrr9rrsetterr$rrtrirrsf *  ^^  $$rtrceZdZdZdZdZy) _LazyTickListz A descriptor for lazy instantiation of tick lists. See comment above definition of the ``majorTicks`` and ``minorTicks`` attributes. c||_yrv)r@)r^rs rir9z_LazyTickList.__init__s  rtc||S|jr-g|_|jd}|g|_|jSg|_|jd}|g|_|jS)NTrF)r@ majorTicks _get_tick minorTicks)r^instanceownerticks ri__get__z_LazyTickList.__get__sx  K{{&(#)))5'+f#***&(#)))6'+f#***rtN)rArrrr9r5rrtrir+r+ s+rtr+c.eZdZdZdZdZejddZdZ dd d fd Z e d Z e jd Z e dZejdZe dZejdZe dZejdZdZdZdZed ZedZdZdZe eedZdzdZdZdZd Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(d{d,Z)dd-Z*e+d|d.Z,dzfd/ Z-d0Z.d|d1Z/d2Z0d|d3Z1d4Z2d5Z3d6Z4d d7d8Z5d9Z6d:Z7dzd;Z8dzdd<d=Z9d>Z:e;jxd?Z=d@Z>dAZ?dBZ@dCZAdDZBdEZCdFZDd}dGZEdHZFdIZGd|dJZHdKZIdLZJddMdNZKd|dOZLdPZMdQZNdRZOdSZPdTZQdUZRdVZSdWZTdzdXZUdzdYZVd~dZZWd[ZXd\ZYd]ZZd^Z[d_Z\d`Z]daZ^dbZ_dcZ`dzddZadeZbdfZcdgZddhZediZfdjZge eBegdkZheidlZjdddmdnZkddMdoZldzddMdpZmdqZndrZodsZpdzdtZqduZrdvZsdwZtdxZudyZvxZwS)Axisa Base class for `.XAxis` and `.YAxis`. Attributes ---------- isDefault_label : bool axes : `~matplotlib.axes.Axes` The `~.axes.Axes` to which the Axis belongs. major : `~matplotlib.axis.Ticker` Determines the major tick positions and their label format. minor : `~matplotlib.axis.Ticker` Determines the minor tick positions and their label format. callbacks : `~matplotlib.cbook.CallbackRegistry` label : `~matplotlib.text.Text` The axis label. labelpad : float The distance between the axis label and the tick labels. Defaults to :rc:`axes.labelpad`. offsetText : `~matplotlib.text.Text` A `.Text` object containing the data offset of the ticks (if any). pickradius : float The acceptance radius for containment tests. See also `.Axis.contains`. majorTicks : list of `.Tick` The major ticks. .. warning:: Ticks are not guaranteed to be persistent. Various operations can create, delete and modify the Tick instances. There is an imminent risk that changes to individual ticks will not survive if you work on the figure further (including also panning/zooming on a displayed figure). Working on the individual ticks is a method of last resort. Use `.set_tick_params` instead if possible. minorTicks : list of `.Tick` The minor ticks. Nz3.10z'get_converter and set_converter methods) alternativecdjt|jg|jjj dS)Nz {}({},{})rr)formattyperAr> transAxesrrxs ri__str__z Axis.__str__`sD!{!! J  I"&))"5"5"?"?"GI IrtT) pickradiusclearct|d|_|j|j dd|_||_t|_t|_ tjdg|_ d|_ tjt j"t j"t$j&dt$j&dt$j&d |_|j+|j(tjt j"t j"|_|j+|j,t$j&d |_||_t3|_t3|_|r|j9d|_ y d |_d|_d |_d|_ y ) a Parameters ---------- axes : `~matplotlib.axes.Axes` The `~.axes.Axes` to which the created Axis belongs. pickradius : float The acceptance radius for containment tests. See also `.Axis.contains`. clear : bool, default: True Whether to clear the Axis on creation. This is not required, e.g., when creating an Axis as part of an Axes, as ``Axes.clear`` will call ``Axis.clear``. .. versionadded:: 3.8 TFr%unitssignalsaxes.labelsizeaxes.labelweightaxes.labelcolor)r5 fontweightr axes.labelpadN)!r8r9_remove_overlapping_locsr<r=isDefault_labelr>rrr$rCallbackRegistry callbacks _autolabelposrTrUrVrWr:r;labelr\ offsetTextlabelpadrAdict_major_tick_kw_minor_tick_kwrB _converter_converter_is_explicitrD _autoscale_on)r^r>rArBrhs rir9z Axis.__init__dsS (,% U34# X X // B!ZZ FFBFF\\"23||$67,,01    tzz***RVVRVV4 t/ _5 $#f"f  JJL " #DO*/D 'DJ!rtc.|jjSrvrrrxs riisDefault_majloczAxis.isDefault_majloczz---rtc&||j_yrvr[r^values rir\zAxis.isDefault_majloc). &rtc.|jjSrvrrrxs riisDefault_majfmtzAxis.isDefault_majfmtzz///rtc&||j_yrvrcr_s rirdzAxis.isDefault_majfmt+0 (rtc.|jjSrvr$rrxs riisDefault_minloczAxis.isDefault_minlocr]rtc&||j_yrvrir_s rirjzAxis.isDefault_minlocrartc.|jjSrvr$rrxs riisDefault_minfmtzAxis.isDefault_minfmtrertc&||j_yrvrmr_s rirnzAxis.isDefault_minfmtrgrtc|jj|jj|jS)z/Return Grouper of shared Axes for current axis.)r> _shared_axes_get_axis_name get_siblingsrxs ri_get_shared_axeszAxis._get_shared_axess3yy%%    !##/< #: ;rtc|j}|jDcgc]}|j|c}Scc}w)z,Return list of shared axis for current axis.)rrrt _axis_map)r^rbrs ri_get_shared_axiszAxis._get_shared_axiss6""$-1-B-B-DEr T"EEEs<cptfdjjjDS)zReturn the axis name.c30K|] \}}|ur|ywrvr)rrbaxisr^s rirz&Axis._get_axis_name..s#%ZT4t|%s)nextr>rvrMrxs`rirrzAxis._get_axis_names/%499+>+>+D+D+F%% %rtr.Fc|jSrv)rLrxs riget_remove_overlapping_locsz Axis.get_remove_overlapping_locss,,,rtc$t||_yrv)boolrLrs riset_remove_overlapping_locsz Axis.set_remove_overlapping_locss(,S %rtzUIf minor ticker locations that overlap with major ticker locations should be trimmed.)doccd|_||jj}|jj ||jj ||fd|_y)a Set the coordinates of the label. By default, the x coordinate of the y label and the y coordinate of the x label are determined by the tick label bounding boxes, but this can lead to poor alignment of multiple labels if there are multiple Axes. You can also specify the coordinate system of the label with the transform. If None, the default coordinate system will be the axes coordinate system: (0, 0) is bottom left, (0.5, 0.5) is center, etc. FNT)rPr>r>rQr set_positionr)r^rrrs riset_label_coordszAxis.set_label_coordssP#   ++I   + A' rtc6|jjS)z,Return the transform used in the Axis' scale)_scale get_transformrxs rirzAxis.get_transforms{{((**rtc.|jjS)z#Return this Axis' scale (as a str).)rrbrxs ri get_scalezAxis.get_scales{{rtc t|tjstj||fi||_n||_|jj |d|_d|_d|_d|_ yr) rmmscale ScaleBase scale_factoryr#set_default_locators_and_formattersr\rjrdrn)r^r`r`s ri _set_scalezAxis._set_scalesd%!1!12 ..udEfEDKDK 77= $ $ $ $rtc P|j}|jjtj tj}|j D]9}|j |j|fi||jd|_ ;|jjtj tj}||k7rF|jjdi|jjDcic] }d|||k( c}yycc}w)a; Set this Axis' scale. Parameters ---------- value : str or `.ScaleBase` The axis scale type to apply. Valid string values are the names of scale classes ("linear", "log", "function",...). These may be the names of any of the :ref:`built-in scales` or of any custom scales registered using `matplotlib.scale.register_scale`. **kwargs If *value* is a string, keywords are passed to the instantiation method of the respective class. TscaleNr) rrget_major_locator nonsingularrVinfrtrvr_update_transScalerr>autoscale_view _axis_names)r^r`r`rbold_default_limsrnew_default_limsrds ri_set_axes_scalezAxis._set_axes_scales ""$ 224(["&&"&&9 '') B )BLL  ) )% :6 :  ! ! #BH !224(["&&"&&9  / / %DII $ $ K37993H3HIaU1#;T )I K 0Js D# cX|jj|||jS)zs Return the range *vmin*, *vmax*, restricted to the domain supported by the current scale. )rlimit_range_for_scale get_minpos)r^vminvmaxs rirzAxis.limit_range_for_scale%s$ {{00tT__=NOOrtc|jS)z'Return whether this Axis is autoscaled.rYrxs ri_get_autoscale_onzAxis._get_autoscale_on,s!!!rtc|||_yy)z Set whether this Axis is autoscaled when drawing or by `.Axes.autoscale_view`. If b is None, then the value is not changed. Parameters ---------- b : bool Nr)r^bs ri_set_autoscale_onzAxis._set_autoscale_on0s =!"D  rtcr|j|jg|j|jSrv)rQrRget_major_ticksget_minor_ticksrxs rirzAxis.get_children=s? DOOB%%'B*.*>*>*@B Brtc|jjtjdxrtjddv|jd<y)Nr"rr r)rUrBr:r;rxs ri_reset_major_tick_kwzAxis._reset_major_tick_kwAI !!# [)E ./3DD H%rtc|jjtjdxrtjddv|jd<y)Nr"rr#r)rVrBr:r;rxs ri_reset_minor_tick_kwzAxis._reset_minor_tick_kwGrrtcR|jj|jjtjd|jj tjd|jj tjd|jjtjd|_|j|jdtjdg|_ tjdxrtjd d v|jd <tjdxrtjd d v|jd <|j!d |_d|_d |_d|_y )z Clear the axis. This resets axis properties to their default values: - the label - the scale - locators, formatters and ticks - major and minor grid - units - registered callbacks rIrGrHrKlinearrDrEr"rr rr#NFT)rQ_reset_visual_defaults set_colorr:r; set_fontsizeset_fontweightrRrS_initrrrNrOrUrV reset_ticksrWrXrDrrxs rirBz Axis.clearMsN ))+ S\\*;<=  -= >? !!#,,/A"BC ..0 _5   !// B [)E ./3DD H% [)E ./3DD H% &+#  rtc |` |` |j|jj y#t$rY5wxYw#t$rYAwxYw#t$rYywxYw)zs Re-initialize the major and minor Tick lists. Each list starts with a single fresh Tick. N)r/AttributeErrorr1rr>patchrxs rirzAxis.reset_ticksxsk      tyy /         s,.=%A :: A A  AAc|j}|dk(rF|j}|jtj|j |j y|dk(rF|j}|jtj|j|j y|dk(rR|j}|jtj|j|j|jy|dk(r&|jtjdy|jtjy) a Display default minor ticks on the Axis, depending on the scale (`~.axis.Axis.get_scale`). Scales use specific minor locators: - log: `~.LogLocator` - symlog: `~.SymmetricalLogLocator` - asinh: `~.AsinhLocator` - logit: `~.LogitLocator` - default: `~.AutoMinorLocator` Displaying minor ticks may reduce performance; you may turn them off using `minorticks_off()` if drawing speed is a problem. logsymlogasinh)basesubslogitTr$N)rrset_minor_locatorr LogLocatorrrSymmetricalLogLocator _transform AsinhLocator linear_width_base_subs LogitLocatorAutoMinorLocator)r^rss ri minorticks_onzAxis.minorticks_ons   E> A  " "7#5#5affaff#E F h  A  " "--allAFFC E g  A  " "((agg./gg7 8g   " "7#7#7d#C D  " "7#;#;#= >rtcJ|jtjy)z!Remove minor ticks from the Axis.N)rr NullLocatorrxs riminorticks_offzAxis.minorticks_offs w2245rtc Xtjgd||j|}|rv|dvr+|j|jj ||dvr+|j |jj ||jd |_y |dvr>|jj ||jD]}|jd i||dvr>|jj ||jD]}|jd i|d|vsd|vrS|jj|jjddxs|jjddd|vr|jj|dd |_y ) aW Set appearance parameters for ticks, ticklabels, and gridlines. For documentation of keyword arguments, see :meth:`matplotlib.axes.Axes.tick_params`. See Also -------- .Axis.get_tick_params View the current style settings for ticks, ticklabels, and gridlines. rr$r!rarr!r$r!rrFrTNr)rrq_translate_tick_paramsrrUupdaterrVrr/rr1rRrgetrr)r^raresetr`kwtransr4s riset_tick_paramszAxis.set_tick_paramss 5UC--f5 ))))+##**73))))+##**73    $ !))##**73 OO2D&D&&112))##**73 OO2D&D&&112W$ g(=++''++J>B**..z5ACw&))',*?@ rtctjddg||dk(r|j|jdS|j|jdS)au Get appearance parameters for ticks, ticklabels, and gridlines. .. versionadded:: 3.7 Parameters ---------- which : {'major', 'minor'}, default: 'major' The group of ticks for which the parameters are retrieved. Returns ------- dict Properties for styling tick elements added to the axis. Notes ----- This method returns the appearance parameters for styling *new* elements added to this axis and may be different from the values on current elements if they were modified directly by the user (e.g., via ``set_*`` methods on individual tick objects). Examples -------- :: >>> ax.yaxis.set_tick_params(labelsize=30, labelcolor='red', ... direction='out', which='major') >>> ax.yaxis.get_tick_params(which='major') {'direction': 'out', 'left': True, 'right': False, 'labelleft': True, 'labelright': False, 'gridOn': False, 'labelsize': 30, 'labelcolor': 'red'} >>> ax.yaxis.get_tick_params(which='minor') {'left': True, 'right': False, 'labelleft': True, 'labelright': False, 'gridOn': False} rr$rTreverse)rrqrrUrV)r^ras riget_tick_paramszAxis.get_tick_paramssc^ GW-U; G ..##T/ **4+>+>*MMrtci|}ddddddddd d d d d ddddddddddddgt}dddd d d d d d ddd }|rNi}|jdk(}gd}|jD]%\} } | |vs |r| |vr|j| || <'n6|jD cic]\} } | |vr| |j| }} } d|vr|jd} | |d<| |d<|D]} | |vst d| d||j ||Scc} } w) a Translate the kwargs supported by `.Axis.set_tick_params` to kwargs supported by `.Tick._apply_params`. In particular, this maps axis specific names like 'top', 'left' to the generic tick1, tick2 logic of the axis. Additionally, there are some other name translations. Returns a new dict of translated kwargs. Note: Use reverse=True to translate from those supported by `.Tick._apply_params` back to those supported by `.Axis.set_tick_params`. r r r r rrrrrrrrrrlength directionleftbottomrighttop labelleft labelbottom labelrightlabeltopr) rrr7rrrrrrrrr)rrrrcolorszkeyword z' is not recognized; valid keywords are )r axis_namerMr ValueErrorr) clskwrkw_ allowed_keyskeymapr is_x_axis y_axis_keysoldkeynewkeyckeys rirzAxis._translate_tick_paramss f GWi '8(H y*j k68We  j  $#$ "'#%$"   G ,IFK"(,,. :S= V{%: *-''&/  :'-lln"FF# 'G s?!A GG $%GL ! +C,& L*++ + ss Dct||||j|jzD]}|j||d|_yr)r8rr/r1r)r^rrchildrhs rirzAxis.set_clip_path[sE dI.__t6 1E   i 0 1 rtctd)z3Return the ``(min, max)`` view limits of this axis.rrrxs rirzAxis.get_view_intervalarrtctd)a7 Set the axis view limits. This method is for internal use; Matplotlib users should typically use e.g. `~.Axes.set_xlim` or `~.Axes.set_ylim`. If *ignore* is False (the default), this method will never reduce the preexisting view limits, only expand them if *vmin* or *vmax* are not within them. Moreover, the order of *vmin* and *vmax* does not matter; the orientation of the axis will not change. If *ignore* is True, the view limits will be set exactly to ``(vmin, vmax)`` in that order. rrr^rrignores riset_view_intervalzAxis.set_view_intervales""9::rtctd)z3Return the ``(min, max)`` data limits of this axis.rrrxs riget_data_intervalzAxis.get_data_intervaltrrtctd)a Set the axis data limits. This method is for internal use. If *ignore* is False (the default), this method will never reduce the preexisting data limits, only expand them if *vmin* or *vmax* are not within them. Moreover, the order of *vmin* and *vmax* does not matter; the orientation of the axis will not change. If *ignore* is True, the data limits will be set exactly to ``(vmin, vmax)`` in that order. rrrs riset_data_intervalzAxis.set_data_intervalxs""9::rtc2|j\}}||kS)a. Return whether this Axis is oriented in the "inverse" direction. The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis. )r)r^lowhighs ri get_invertedzAxis.get_inverteds **, Tczrtcz|j\}}|jt||ft|ddiy)a+ Set whether this Axis is oriented in the "inverse" direction. The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis. rrlN)r_set_limsortedr)r^invertedrrs ri set_invertedzAxis.set_inverteds8%%'1 vq!fd8n=IDIrtcy)z{ Set the default limits for the axis data and view interval if they have not been not mutated yet. Nrrxs riset_default_intervalszAxis.set_default_intervalssrt)emitc~|j}|jj|||ffgd|jj||j}|jj||j}|||j \}}||}||}|j dk(r]|dks|dkrS|j \}}|dkrtjd|d|}|dkrtjd|d|}||k(rtjd|dt||kD}|jj||\}}|j||\}}t||gt| \}}|j||d |jD]} d| j |<|j#||r|jj$j'|d |j|jD]} | |jur| j(|j+||d| |r| j$j'|d | | j-dx} |j-dk7s}| j.j1d |_||fS)a` Set view limits. This method is a helper for the Axes ``set_xlim``, ``set_ylim``, and ``set_zlim`` methods. Parameters ---------- v0, v1 : float The view limits. (Passing *v0* as a (low, high) pair is not supported; normalization must occur in the Axes setters.) 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. F)convertrrzAttempt to set non-positive z)lim on a log-scaled axis will be ignored.z)Attempting to set identical low and high z_process_unit_info_validate_converted_limits convert_unitsrrr warn_externalrrrrr rrt_stale_viewlimsrrOprocessrvrr=canvas draw_idler) r^v0v1rrlrbold0old1rrother other_figs rirz Axis._set_lims$""$ $$tb"X&6%7$G YY 1 1"d6H6H I YY 1 1"d6H6H I ://1JD$zz >> u $"'R1W//1JD$Qw""%A$HH$IJQw""%A$HH$IJ 8   ;D6BJK LrBw-'')55b"=B++B3BR$w-8B r2d3'') -B',B  t $ - t$  II   ' '4& (>YU34$$..0 1 2v rtcL|y|j|jdyrrrs rir\zAxis._set_artist_propss! 9  T__%_01rtc|j}|jjj|}|j t |}t |||D]M\}}}|j||jj||jj|O|j}|jjj|}|jt |} t | ||D]M\}}}|j||jj||jj|Og|| } |j\} } | | kDr| | } } t|drC|j j"dk(r*t$j&drd} | | z }| || zz } | || zz} |j)j+| | g}g}| D]X} |j)j+|j-}t/j0||sH|j3|Z|S#t4$rYhwxYw)z Update ticks (position and labels) using the current data interval of the axes. Return the list of ticks that will be drawn. r>3dzaxes3d.automargingqq?)get_majorticklocsrr$ format_ticksrlenzipr]rYset_textrZget_minorticklocsr$rrhasattrr>rbr:r;rrr mtransforms_interval_contains_closeappendAssertionError)r^ major_locs major_labels major_ticksr4r_rQ minor_locs minor_labels minor_ticksticksview_low view_highmargindelta interval_t ticks_to_drawloc_ts ri _update_tickszAxis._update_tickss< ++- zz++88D **3z?; #K\ J ( D#u   % KK  ' KK  ' (++- zz++88D **3z?; #K\ J ( D#u   % KK  ' KK  ' (-+, ,"446) i "+XiH D& !diinn&<LL!45 *F(E!EFN2I%&.0H'')33Xy4IJ   /D /**,66t||~F 77 EJ!((. /"  s3-I  IIcf| |jdj}|Dcgc]7}|jjr|jj |9c}|Dcgc]7}|j jr|j j |9c}fScc}wcc}w)z8Return lists of bboxes for ticks' label1's and label2's.Tr%)r= _get_rendererrYrget_window_extentrZ)r^r5rr4s ri_get_ticklabel_bboxeszAxis._get_ticklabel_bboxes0s  D1??AH"Adkk&=&=&?..x8A#Adkk&=&=&?..x8AB BAAs .Rs-"!!(+"s+.rrrrr)r get_in_layoutr=r?r=_update_label_positionrA_update_offset_text_positionrRr(rr$ get_offsetrQr@rr x0x1heighty0y1r-rVrr+Bboxunion) r^rrBr;tlb1tlb2bboxesbbrs ` ri get_tightbboxzAxis.get_tightbbox9s!_T=O=O=Q   D1??AH**,  ##H-// xH d ))$5   !5!5!@!@!BC "("      :: ! ! #--h7B>>S(RXX\UURUU]a/#5BEEECKBE>>S(RYY]UURUU]a/#5BEEECKBE MM" #E)266)a!((.CRVV.CEE ##))&1 1 Es AIc$g}t|jr,|j|jdjt|jr,|j|jdjt |dS)Nr)rk)r&r/r-rwr1max)r^valuess rirwzAxis.get_tick_paddinglsh t  MM$//!,==? @ t  MM$//!,==? @61%%rtcN|jsy|jt|j|j }|j ||\}}|D]}|j ||j||jj ||j|||jj|jjj|jj ||jtd|_y)NrF)rrrArr=rArrGrQrHrRr(rr$rIrr)r^rr;rQrRr4s rirz Axis.drawts! H$,,.9**, // xH d! D IIh   ##H- ! ))$5   !5!5!@!@!BC X&X& rtc|j}tjd|Dcgc]}|jc}Scc}w)z6Return this Axis' grid lines as a list of `.Line2D`\s.zLine2D gridline)rr silent_listrP)r^r5r4s ri get_gridlineszAxis.get_gridliness=$$&  !2Assigning legend labels is not supported. Raises RuntimeError.zfA legend label cannot be assigned to an Axis. Did you mean to set the axis label via set_label_text()?) RuntimeError)r^rs ri set_labelzAxis.set_labels 78 8rtc|jS)a  Return the axis label as a Text instance. .. admonition:: Discouraged This overrides `.Artist.get_label`, which is for legend labels, with a new semantic. It is recommended to use the attribute ``Axis.label`` instead. )rQrxs ri get_labelzAxis.get_labelszzrtc|jS)z.Return the axis offsetText as a Text instance.)rRrxs riget_offset_textzAxis.get_offset_textr%rtc|jS)z0Return the depth of the axis used by the picker.) _pickradiusrxs riget_pickradiuszAxis.get_pickradiussrtc0|j|j}|Dcgc])}|jjs|j+}}|Dcgc])}|jjs|j+}}||zScc}wcc}w)z@Return this Axis' major tick labels, as a list of `~.text.Text`.)r=rrYrrZr^r5r4labels1labels2s riget_majorticklabelszAxis.get_majorticklabels| $$&+0N4DKK4K4K4M4;;NN+0N4DKK4K4K4M4;;NN  ONBBB9Bc0|j|j}|Dcgc])}|jjs|j+}}|Dcgc])}|jjs|j+}}||zScc}wcc}w)z@Return this Axis' minor tick labels, as a list of `~.text.Text`.)r=rrYrrZrhs riget_minorticklabelszAxis.get_minorticklabelsrlrmc|i|dk(r|jS|dk(r|jS|dk(r!|j|jzStjgd||r|jS|jS)aq Get this Axis' tick labels. Parameters ---------- minor : bool Whether to return the minor or the major ticklabels. which : None, ('minor', 'major', 'both') Overrides *minor*. Selects which ticklabels to return Returns ------- list of `~matplotlib.text.Text` r$rr!rr)rorkrrq)r^r$ras riget_ticklabelszAxis.get_ticklabelss$  //11'!//11&//1D4L4L4NNN""#=UK ++- -''))rtcg}|j}|D]8}|j|j|j|j:t j d|S)zNr)atolrtolr4)rz) rVasarrayr$rremove_overlapping_locsrrrrr riscloser) r^r2r/r tr_minor_locs tr_major_locslohitolmasks rir)zAxis.get_minorticklocssZZ 2 2 45  ' '++-J 113I%// ;M%// ;MI//0F0F0HIJFB7d"C::mAtG4mD!G6L#&Q003  #TE*JrtrcF|r|jS|jS)a Return this Axis' tick locations in data coordinates. The locations are not clipped to the current axis limits and hence may contain locations that are not visible in the output. Parameters ---------- minor : bool, default: False True to return the minor tick directions, False to return the major tick directions. Returns ------- array of tick locations )r)r$r{s ri get_ticklocszAxis.get_ticklocs s#",1t%%'Nd6L6L6NNrtc|r;tj|jDcgc]}|jc}Stj|j Dcgc]}|jc}Scc}wcc}w)a; Return an array of this Axis' tick directions. Parameters ---------- minor : bool, default: False True to return the minor tick directions, False to return the major tick directions. Returns ------- array of tick directions )rVarrayrr~r)r^r$r4s riget_ticks_directionzAxis.get_ticks_directionsq 88+/+?+?+AB4BD D88+/+?+?+AB4BD DCCs A9A>c|j#td|jjd|r |jn |j }|j|j dfd|i|S)z!Return the default tick instance.zThe Axis subclass z3 must define _tick_class or reimplement _get_tick()rr) _tick_classrrhrArUrVr>)r^rrs rir0zAxis._get_tick1sq    #%$T^^%<%<$=>99: :*/$%%D4G4Gt 1EEEWEErtc|j}|jdtj|d}t j |j S)z Return the text size of tick labels for this Axis. This is a convenience function to avoid having to create a `Tick` in `.get_tick_space`, since it is expensive. rztick.labelsize)r )rUrr:r;rTFontPropertiesget_size_in_points)r^rrr s ri_get_tick_label_sizezAxis._get_tick_label_size:sM%%{{;<<9+^(DEG##.AACCrtc||y|jj|j|jj|j|jj|j|jj|j|j j|j |j||j |_|j|_|j|_|j|_ |j|_ |j|_ |j|_ y)z3Copy the properties from *src* tick to *dest* tick.N) rY update_fromrZrNrOrPr?rBrCrDrXrIr~)r^srcdests ri_copy_tick_propszAxis._copy_tick_propsFs ;$,   +  + ""3==1 ""3==1 !!#,,/ HH YY jj !00{{   rtc6|jjS)zGet the text of the label.)rQget_textrxs riget_label_textzAxis.get_label_textXszz""$$rtc.|jjS)z$Get the locator of the major ticker.r~rxs rirzAxis.get_major_locator\zz!!!rtc.|jjS)z$Get the locator of the minor ticker.)r$rrxs riget_minor_locatorzAxis.get_minor_locator`rrtc.|jjS)z&Get the formatter of the major ticker.)rr$rxs riget_major_formatterzAxis.get_major_formatterdzz###rtc.|jjS)z&Get the formatter of the minor ticker.)r$r$rxs riget_minor_formatterzAxis.get_minor_formatterhrrtcP|t|j}t|j|kre|jd}|jj ||j |jd|t|j|kre|jd|S)a Return the list of major `.Tick`\s. .. warning:: Ticks are not guaranteed to be persistent. Various operations can create, delete and modify the Tick instances. There is an imminent risk that changes to individual ticks will not survive if you work on the figure further (including also panning/zooming on a displayed figure). Working on the individual ticks is a method of last resort. Use `.set_tick_params` instead if possible. NTr.r)r&r$r/r0r-rr^numticksr4s rirzAxis.get_major_ticksls  41134H$//"X->>>-D OO " "4 (  ! !$//!"4d ; $//"X- y))rtcP|t|j}t|j|kre|jd}|jj ||j |jd|t|j|kre|jd|S)a Return the list of minor `.Tick`\s. .. warning:: Ticks are not guaranteed to be persistent. Various operations can create, delete and modify the Tick instances. There is an imminent risk that changes to individual ticks will not survive if you work on the figure further (including also panning/zooming on a displayed figure). Working on the individual ticks is a method of last resort. Use `.set_tick_params` instead if possible. NFr.r)r&r)r1r0r-rrs rirzAxis.get_minor_tickss  41134H$//"X->>>.D OO " "4 (  ! !$//!"4d ; $//"X- y))rtc |r|d}n|stjdd}|j}tjgd||j Dcic] \}}d|| }}}|dvr+||j d n||d<|j d d d i||d vr+||jd n||d<|j d d d i|d|_ycc}}w)a Configure the grid lines. Parameters ---------- visible : bool or None 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'} The grid lines 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) NTz_First parameter to grid() is false, but line properties are supplied. The grid will be enabled.rrrrrrar$rrr) rrlowerrqrMrVrrUr)r^r,rar`rbr`gridkws rirz Axis.grids * ""$;<  5UC;A<<>JKD%E$.%'JJ % %#*?%)$7$7$A A8? 8  D 9w 9& 9 % %#*?%)$7$7$A A8? 8  D 9w 9& 9 KsCcr|js tjj|}n |j}|y|j|k7}|j ||jj ||}|%|j|j|d|_ y|r|jd|_ y)z Introspect *data* for units converter and update the ``axis.get_converter`` instance if necessary. Return *True* if *data* is registered for unit conversion. FT) rXmunitsregistry get_converterrW_set_converter default_unitsrD set_units_update_axisinfor)r^r converterneednewrks ri update_unitszAxis.update_unitss **55d;II  //Y. I&////d;  4::#5 NN7 #   ! ! # rtc|jy|jj|j|}|y|jQ|jj |jk7r.|j r"|j|jd|_|jQ|jj |jk7r.|jr"|j|jd|_ |jQ|jj|jk7r.|jr"|j|jd|_|j Q|jj|j k7r.|j"r"|j%|j d|_|j&.|j(r"|j+|j&d|_|j-y)zt Check the axis converter for the stored units to see if the axis info needs to be updated. NT)rWaxisinforDmajlocrrr\set_major_locatorminlocr$rjrmajfmtr$rdset_major_formatterminfmtrnset_minor_formatterrQrMset_label_textr )r^infos rirzAxis._update_axisinfoss ?? " '' D9 <  ;; " ::   ,1F1F  " "4;; /$(D ! ;; " ::   ,1F1F  " "4;; /$(D ! ;; " ::  4;; .43H3H  $ $T[[ 1$(D ! ;; " ::  4;; .43H3H  $ $T[[ 1$(D ! :: !d&:&:    +#'D  ""$rtc>|jduxs|jduSrv)rWrDrxs ri have_unitszAxis.have_unitssd*Ddjj.DDrtchtj|r|S|j.|jtjj ||j|S |jj ||j|}|S#t$r}tjd||d}~wwxYw)Nz*Failed to convert value(s) to axis units: ) r_is_natively_supportedrWrrrrrD ExceptionConversionError)r^rretes rirzAxis.convert_unitss  ( ( +H ?? "    = =a @ A ?? "H A//))!TZZ>C  A((*334%*9:?@ A As!'B B1B,,B1c|jS)z Get the unit converter for axis. Returns ------- `~matplotlib.units.ConversionInterface` or None )rWrxs rirzAxis.get_convertersrtc4|j|d|_y)z Set the unit converter for axis. Parameters ---------- converter : `~matplotlib.units.ConversionInterface` TN)rrXr^rs ri set_converterzAxis.set_converter#s I&&*#rtc:|j|us|j|k(ry|jr td|jSt|t |js4t|jt |st j d||_y)Nz*Axis already has an explicit converter setz]This axis already has a converter set and is updating to a potentially incompatible converter)rWrXr^rmr=rrrs rirzAxis._set_converter.s} ??i '4??i+G   & &KL L OO '9d4??&;<4??DO<   F $rtc||jk(ry|jD];}||_|j|jj dd|_=y)z Set the units for axis. Parameters ---------- u : units tag Notes ----- The units of any shared axis will also be updated. NrDT)rDrwrrOrr)r^urzs rirzAxis.set_units>sV  ? ))+ DDJ  ! ! # NN " "7 +DJ  rtc|jS)zReturn the units for axis.)rDrxs ri get_unitszAxis.get_unitsRs zzrtc d|_|jj|||jj||jj|d|_|jS)a Set the text value of the axis label. Parameters ---------- label : str Text string. fontdict : dict Text properties. .. admonition:: Discouraged The use of *fontdict* is discouraged. Parameters should be passed as individual keyword arguments or using dictionary-unpacking ``set_label_text(..., **fontdict)``. **kwargs Merged into fontdict. FT)rMrQr(rr)r^rQfontdictr`s rirzAxis.set_label_textVsY( % E"   JJ  h ' &! zzrtc<|j||jy)a Set the formatter of the major ticker. In addition to a `~matplotlib.ticker.Formatter` instance, this also accepts a ``str`` or function. For a ``str`` a `~matplotlib.ticker.StrMethodFormatter` is used. The field used for the value must be labeled ``'x'`` and the field used for the position must be labeled ``'pos'``. See the `~matplotlib.ticker.StrMethodFormatter` documentation for more information. For a function, a `~matplotlib.ticker.FuncFormatter` is used. The function must take two inputs (a tick value ``x`` and a position ``pos``), and return a string containing the corresponding tick label. See the `~matplotlib.ticker.FuncFormatter` documentation for more information. Parameters ---------- formatter : `~matplotlib.ticker.Formatter`, ``str``, or function N)_set_formatterrr(s rirzAxis.set_major_formatterrs0 Itzz2rtc<|j||jy)aZ Set the formatter of the minor ticker. In addition to a `~matplotlib.ticker.Formatter` instance, this also accepts a ``str`` or function. See `.Axis.set_major_formatter` for more information. Parameters ---------- formatter : `~matplotlib.ticker.Formatter`, ``str``, or function N)rr$r(s rirzAxis.set_minor_formatters Itzz2rtc`t|trtj|}n`t |r0t|tj stj |}n%tjtj|t|tjrQt|jdkDr9t|jtjstjd||j k(rd|_nd|_||_|j)|d|_y)N)r$r=FixedFormatter should only be used together with FixedLocatorFT)rmrnrStrMethodFormattercallable TickHelper FuncFormatterrcheck_isinstancer'FixedFormatterr&seqr FixedLocatorrrrdrnr$set_axisr)r^r$levels rirzAxis._set_formatters i %229=Iy!Y(:(:;--i8I  ! !'"3"3y I y'"8"8 9 &*"5=='2F2FG    3 4 DJJ $)D !$)D !#4  rtc$tjtj|d|_||j _|j jr%|j jj||j|d|_ y)z Set the locator of the major ticker. Parameters ---------- locator : `~matplotlib.ticker.Locator` rFTN) rrrr r\rrr$ _set_locatorrrr"s rirzAxis.set_major_locatorf goow? %$  ::   JJ - -g 6 rtc$tjtj|d|_||j _|j jr%|j jj||j|d|_ y)z Set the locator of the minor ticker. Parameters ---------- locator : `~matplotlib.ticker.Locator` rFTN) rrrr rjr$rr$rrrr"s rirzAxis.set_minor_locatorrrtcRt|tr|dkr td||_y)z Set the depth of the axis used by the picker. Parameters ---------- pickradius : float The acceptance radius for containment tests. See also `.Axis.contains`. rz pick radius should be a distanceN)rmrrre)r^rAs riset_pickradiuszAxis.set_pickradiuss(*d+zA~?@ @%rtzGThe acceptance radius for containment tests. See also `.Axis.contains`.c&|j|dS)Nr0)r)tickdrposs ri_format_with_dictzAxis._format_with_dictsyyBrt)r$rc  |Dcgc] }t|dr|jn|"}}|r|jn|j }|st j }nt|t jrt|jt|k7r?? /2',,.GH(#sS#XHEH$$T%;%;UCD--d3I   J K ..v6I  $ $ & 8  # #W Y((3--/,,SY7((3--/,,SY7 8   MM( # )#dE*: ; ( C#t   %"3,J KK  , KK ( ( 0 KK  , KK ( ( 0{{&&( 4;;'{{&&( 4;;' (  w' Hvaj(;<=4 G H I 8 8s.M%MM7 M%;BM+MM"+M5c|j|}tj|}t|r9|j D]&}|j t |t|(d|j_ |r+|j||jt|S|j||jt|Sr)rrrr&rwrminrWr>rrrrr)r^r5r$rrzs ri_set_tick_locationszAxis._set_tick_locationsjs""5)&&u- u:--/ ?&&s5z3u:> ?    " "7 +''E 3 3  " "7 +''E 3 3rtc |%|r#tt|}td|d|j||}||j|fd|i||S)al Set this Axis' tick locations and optionally tick labels. If necessary, the view limits of the Axis are expanded so that all given ticks are visible. Parameters ---------- ticks : 1D array-like Array of tick locations (either floats or in axis units). The axis `.Locator` is replaced by a `~.ticker.FixedLocator`. Pass an empty list (``set_ticks([])``) to remove all ticks. Some tick formatters will not label arbitrary tick positions; e.g. log formatters only label decade ticks by default. In such a case you can set a formatter explicitly on the axis using `.Axis.set_major_formatter` or provide formatted *labels* yourself. labels : list of str, optional Tick labels for each location in *ticks*; must have the same length as *ticks*. If set, the labels are used as is, via a `.FixedFormatter`. If not set, the labels are generated using the axis tick `.Formatter`. minor : bool, default: False If ``False``, set only the major ticks; if ``True``, only the minor ticks. **kwargs `.Text` properties for the labels. Using these is only allowed if you pass *labels*. In other cases, please use `~.Axes.tick_params`. Notes ----- The mandatory expansion of the view limits is an intentional design choice to prevent the surprise of a non-visible tick. If you need other limits, you should set the limits explicitly after setting the ticks. z"Incorrect use of keyword argument zr. Keyword arguments other than 'minor' modify the text labels and can only be used if 'labels' are passed as well.rr$)r{iterrrr)r^r5rr$r` first_keyresults ri set_tickszAxis.set_ticks|suP >fT&\*I4YMB//0 0))%u)=   D   >e >v > rtc|j}||jdjvrggfS|jdj|}g}g}|j|jD]X}|j |}|j }|j||\} } |j| |j| Z||fS)z Get the bounding boxes for this `.axis` and its siblings as set by `.Figure.align_xlabels` or `.Figure.align_ylabels`. By default, it just gets bboxes for *self*. Fr%) rrr=_align_label_groupsrsr>rvr=rAextend) r^rrbgrouperrSbboxes2rrzr;tlbrRs ri_get_tick_boxes_siblingszAxis._get_tick_boxes_siblingss""$ tE2FF Fr6M//u/-AA$G&&tyy1 !B<<%D ..0M22=(KIC MM#  NN4  ! wrtctd)zz Update the label position based on the bounding box enclosing all the ticklabels and axis spine. rr)r^rs rirGzAxis._update_label_position ""9::rtctd)zx Update the offset text position based on the sequence of bounding boxes of all the ticklabels. rr)r^rSrs rirHz!Axis._update_offset_text_positionrrtc t|trddl}|jj |}|j t j ddddddd|y)z Set up axis ticks and labels to treat data along this Axis as dates. Parameters ---------- tz : str or `datetime.tzinfo`, default: :rc:`timezone` The timezone used to create date labels. rNir4)rmrn dateutil.tztzgettzrdatetime)r^rdateutils ri axis_datezAxis.axis_datesL b#  ""2&B (++D!Q1aBGHrtct)z>Return the estimated number of ticks that can fit on the axis.rrxs riget_tick_spacezAxis.get_tick_spaces "##rtc|jd}|jd}td||fDrytd||fDrytd||fDryy) a[ Helper for `XAxis.get_ticks_position` and `YAxis.get_ticks_position`. Check the visibility of tick1line, label1, tick2line, and label2 on the first major and the first minor ticks, and return - 1 if only tick1line and label1 are visible (which corresponds to "bottom" for the x-axis and "left" for the y-axis); - 2 if only tick2line and label2 are visible (which corresponds to "top" for the x-axis and "right" for the y-axis); - "default" if only tick1line, tick2line and label1 are visible; - "unknown" otherwise. rc3K|]t}|jjxrT|jj xr7|jjxr|jj vywrvrNrrOrYrZrr4s rirz+Axis._get_ticks_position..ss+ ~~))+1~~11331;;**,1{{..001+A:A<r4c3K|]t}|jjxrT|jj xr7|jjxr|jj vywrv)rOrrNrZrYr!s rirz+Axis._get_ticks_position.. ss- ++-333553[[,,.300223-r"rEc3K|]s}|jjxrS|jjxr7|jjxr|jj uywrvr r!s rirz+Axis._get_ticks_position.. sp- ++-3^^//13[[,,.300223-sA9A;rkunknown)r/r1all)r^rr$s ri_get_ticks_positionzAxis._get_ticks_positions"" +"5> + +  -$U^ --  -$U^ -- rtc|jS)z; Return the label position (top or bottom) )label_positionrxs riget_label_positionzAxis.get_label_position s"""rtct) Set the label position (top or bottom) Parameters ---------- position : {'top', 'bottom'} rr^positions riset_label_positionzAxis.set_label_position s "##rtctrvrrxs rirzAxis.get_minpos s !##rtrv)rFF)FN)Nr)xrArrr OFFSETTEXTPADrrdeprecate_privatize_attributerr?r9rr\r)rdrjrnrtrwrrr+r/r1r}rrrrrrrrrrrrrrBrrrrr classmethodrrrrrrrr r rr\r=rArUrwrrrr\r_rarcrfrkrorqrvryr|r$r)rrr0rrrrrrrrrrrrrrrrrrrrrrrrrrrA staticmethodrrrr rrGrHrrr'r*r/rrrs@rir7r7-s(RMK222 II I,.T7"r..//0011..//0011; F %T*JU+J-2'#%@35 (+  %K>P" #BF F )V( ?D6+Z4NlCCJ ; ;; ;  J (,JX2 2hB1e1f&   !0D 8  !!*><<) $$%*O&D*F D%$%""$$*4*4(T2 %DE" +$ (834 34  &-89J   /4d}~384$1U1f.;;I"$ #J# $$rtr7c\fddfd d|d_d|d_fS)zo Helper to generate ``get_{data,view}_interval`` and ``set_{data,view}_interval`` implementations. cDtt|jSrv)getattrr>)r^ attr_namelim_names rigetterz%_make_getset_interval..getter) swtyy(3Y??rtc &|r+tt|j||fd|_y|\}}||kr* |t|||t |||dd|_y |t |||t|||dd|_y)NTr)rr8r>rrWr) r^rrroldminoldmaxr9r;r:r)s rir)z%_make_getset_interval..setter- s  GDIIx0)dD\ J $D\NFFtStV4c$f6M"$  tStV4c$f6M"$ rtget_ _intervalset_r1)rA) method_namer:r9r;r)s ``@@ri_make_getset_intervalrC# s? @  [M3FO[M3FO 6>rtceZdZdZdZeZfdZdZdZdZ dZ dZ d Z d Z d Zd Zed dd\ZZeddd\ZZdZdZdZxZS)XAxisxaxisrcDt||i||jyrvr8r9rr^rr`rhs rir9zXAxis.__init__F  $)&) rtc (|jjddddtj|jj tj d|_tjddk(rtjd }ntjd}|jjd ddd tj|jj tj tjd | d|_ y)| Initialize the label and offsetText instance values and `label_position` / `offset_text_position`. rrrcenterrrzxtick.labelcolorr(z xtick.colorr4rzxtick.labelsizerrrrrr5r N) rQrr+blended_transform_factoryr>r>IdentityTransformr)r:r;rRoffset_text_positionr^ tick_colors rirz XAxis._initJ s Q#!;; ##[%B%B%DF  ' <<* +y 8m4J&89J 1#!;; ##[%B%B%DF\\"34  %-!rtc|j|rdifS|j|j}} |jjj }|j ||f\}}|jjj ddg\\}}\} } d|cxkxrdkncxr<||jz |cxkxr|kncxs| |cxkxr| |jzknc} | ifS#t$rdifcYSwxYw)z4Test whether the mouse event occurred in the x-axis.Fr;r4r4rr4 _different_canvasrrr>r>r rrre r^rrrrxaxesyaxeslrrrinaxiss rirzXAxis.containsh  ! !* -"9 ||Z\\1 II''002E ??Aq62LE5,,667GHAAeq*   1 (q ( )  (A((( ( rz  "9  :C++ C;:C;c|jjtjddd|||_d|_y)r,baseliner)rrr.TN)rQset_verticalalignmentr check_getitemr)rr-s rir/zXAxis.set_label_positionx sA ((););= * ' rtcn|jsy|j|\}}|jj\}}|jdk(rt j jg||jjjd|jj}|jj||j|j|jdj zdz z fyt j jg||jjjd|jj}|jj||j"|j|jdj zdz zfy)y Update the label position based on the bounding box enclosing all the ticklabels and axis spine NrrTr%Hr)rPrrQ get_positionr)r+rOrPr>spinesrr@rrMrSr=dpirNr^rrSrrrbboxs rirGzXAxis._update_label_position s{ !! 777Jzz&&(1   ( *##))+X+X))--h BTTV+XYD JJ # #DGGdmmdoo4o.H.L.LLrQQR T##))+V+V))**..udii@RRT+VWD JJ # #DGGdmmdoo4o.H.L.LLrQQR Trtc|jj\}}t|dsd|_|jdk(rt |s!|j j j}n+tjj|}|j}||j|jdjzdz z }nt |s!|j j j}n+tjj|}|j }||j|jdjzdz z}|jj#||fy)w Update the offset_text position based on the sequence of bounding boxes of all the ticklabels _tick_positionrTr%rhN)rRrir*rpr&r>rmyminr+rOrPrMr2r=rkymaxrNr)r^rSrrrrrmrs rirHz"XAxis._update_offset_text_position s ++-1t-."*D    ( *v;,,"''--f5++doo4o.H.L.LLrQQAw<iinn))"''--g6ggd((4???+E+I+IIBNNA $$aV,rtcf|dk(r@|jdddddd|_|jjdd|_y |dk(r@|jdddddd|_|jjdd|_y |dk(r|jdddd|_y |dk(r|jdddd|_y |d k(r@|jdddddd|_|jjdd|_y t j gd | d|_y ) a Set the ticks position. Parameters ---------- position : {'top', 'bottom', 'both', 'default', 'none'} 'both' sets the ticks to appear on both positions, but does not change the tick labels. 'default' resets the tick positions to the default: ticks on both positions, labels at bottom. 'none' can be used if you don't want any ticks. 'none' and 'both' affect only the ticks, not the labels. rr!TF)rarrrrr)rarrr*rk)rrr!rkr*rbN)rrprRrcrrqrr-s riset_ticks_positionzXAxis.set_ticks_position s] u   v4$(-5 ! B"'D  OO 1 1( ;( ' !  v55(,$ ! @"*D  OO 1 1% 8    v4(, ! .    v5(- ! /  "  v4%(,$ ! @"*D  OO 1 1% 8    K(0 2 rtcd}d|jvr |jdxs|jd}|jd|jd|y)zP Move ticks and ticklabels (if present) to the top of the Axes. Trrrr!)rarNrUrtrr^rQs ritick_topzXAxis.tick_top s^ ,, ,((48++J7  & 6E:rtcd}d|jvr |jdxs|jd}|jd|jd|y)zS Move ticks and ticklabels (if present) to the bottom of the Axes. Trrrr!)rarNrvrws ri tick_bottomzXAxis.tick_bottom s^ ,, ,((48++J7  ) 6u=rtc2ddddd|jS)zW Return the ticks position ("top", "bottom", "default", or "unknown"). rrrkr%r4rErkr%r'rxs riget_ticks_positionzXAxis.get_ticks_position s)$<,,.0 0rtviewrrrdataLimcB|jjjSrv)r>rminposxrxs rirzXAxis.get_minpos yy  (((rtc|jjjs|jjjsy|jm|jj |j |}|j;|j|j\}}||f|jj_ d|_ yr) r>rmutatedxrrWrrDdefault_limitsrrr)r^rxminxmaxs rir zXAxis.set_default_intervals  !!**,II%%..0*// DA&&2!%!3!3D4G4G!HJD$26*DII%%/ rtcRtjjj|jj |j djz }|jdz}|jddz}|dkDr!ttj||z Sy)NFr%rhrr8r) r+rOunit transformedr>r>r=dpi_scale_transr rintrVfloorr^endsrr s rirzXAxis.get_tick_space s$$&22 II  $//u/"="M"M MOb((-1 !8rxx ./ /rt)rArrrrrr9rrr/rGrHrtrxrzr~rCrrrrrr rrrs@rirErEA sHIK-< T4-0%N ; >0,A ;,(((+@ ;,((()  rtrEceZdZdZdZeZfdZdZdZdZ dZ dZ d Z d Z d Zd Zd Zeddd\ZZeddd\ZZdZdZdZxZS)YAxisyaxisrcDt||i||jyrvrHrIs rir9zYAxis.__init__& rJrtc ,|jjddddddtjtj|j j d|_tjd d k(rtjd }ntjd }|jjddd dtj|j j tjtjd |d|_ y)rLrrrrMverticalanchor)rrrrr7 rotation_moderrzytick.labelcolorr(z ytick.colorrazytick.labelsizerNN) rQrr+rOrPr>r>r)r:r;rRrQrRs rirz YAxis._init* s 3&Hx!;;--/1D1DF  % <<* +y 8m4J&89J 3(f!;; ##[%B%B%DF\\"34  %+!rtc|j|rdifS|j|j}} |jjj }|j ||f\}}|jjj ddg\\}}\} } d|cxkxrdkncxr<||jz |cxkxr|kncxs| |cxkxr| |jzknc} | ifS#t$rdifcYSwxYw)NFr;rUrr4rVrXs rirzYAxis.containsJ r^r_c|jjd|jjtjddd|||_d|_y)z Set the label position (left or right) Parameters ---------- position : {'left', 'right'} rrrrrrbTN)rQset_rotation_modercrrdr)rr-s rir/zYAxis.set_label_positionZ sS $$X. ((););u= * ' rtcn|jsy|j|\}}|jj\}}|jdk(rt j jg||jjjd|jj}|jj|j|j|jdj zdz z |fyt j jg||jjjd|jj}|jj|j"|j|jdj zdz z|fy)rfNrgrTr%rhr)rPrrQrir)r+rOrPr>rjrr@rrJrSr=rkrKrls rirGzYAxis._update_label_positioni s} !! 777Jzz&&(1   & (##))+V+V))--fdii@RRT+VWD JJ # #4==4???+E+I+IIBNNPQR T##))+X+X))**..w BTTV+XYD JJ # #4==4???+E+I+IIBNNPQR Trtc|jj\}}d|jjvr(|jjdj }n|jj }|j }|jj|||j|jdjzdz zfy)rooutlineTr%rhN) rRrir>rjr@rmrrrr2r=rk)r^rSrrrrmrs rirHz"YAxis._update_offset_text_position s ++-1  (( (99##I.@@BD99>>Dii $$ d((4???+E+I+IIBNN O rtc|jj\}}tjddd|}|jj ||jj ||fd|_y)zT Parameters ---------- position : {'left', 'right'} rr4rrbTN)rRrirrdset_harr)r^r.rrs riset_offset_positionzYAxis.set_offset_position s` ++-1   A6 J x( $$aV, rtc|dk(r/|jddddd|j|d|_y |dk(r/|jddddd|j|d|_y |dk(r|jdddd|_y |dk(r|jdddd|_y |d k(r|jdddddd|_y tjgd | d|_y ) a Set the ticks position. Parameters ---------- position : {'left', 'right', 'both', 'default', 'none'} 'both' sets the ticks to appear on both positions, but does not change the tick labels. 'default' resets the tick positions to the default: ticks on both positions, labels at left. 'none' can be used if you don't want any ticks. 'none' and 'both' affect only the ticks, not the labels. rr!TF)rarrrrr)rarrr*rk)rrr!rkr*rbN)rrrrqrr-s rirtzYAxis.set_ticks_position s( w   vTd&+u ! >  $ $X ." !   vUu&*d ! <  $ $X .    vT&* ! ,    vU&+ ! -  "  vTe&*d ! <     K(0 2 rtcd}d|jvr |jdxs|jd}|jd|jd|y)zR Move ticks and ticklabels (if present) to the right of the Axes. Trrrr!)rarNrvrws ri tick_rightzYAxis.tick_right s` ,, ,((48++J7  ( 6erminposyrxs rirzYAxis.get_minpos rrtc|jjjs|jjjsy|jm|jj |j |}|j;|j|j\}}||f|jj_ d|_ yr) r>rmutatedyrrWrrDrrrr)r^rrqrrs rir zYAxis.set_default_intervals rrtcRtjjj|jj |j djz }|jdz}|jddz}|dkDr!ttj||z Sy)NFr%rhrrErr) r+rOrrr>r>r=rrLrrrVrrs rirzYAxis.get_tick_space s$$&22 II  $//u/"="M"M MOr!((-1 !8rxx ./ /rt)rArrrrrr9rrr/rGrHrrtrrr~rCrrrrrr rrrs@rirr! sHIK+@ T4 !F = <0,A ;,(((+@ ;,((()  rtr)>rrrloggingnumbersrrnumpyrV matplotlibr:rrmatplotlib.artistrgrmatplotlib.colorsrrKmatplotlib.linesrurGmatplotlib.scalerrmatplotlib.texttextrTmatplotlib.tickertickerrmatplotlib.transforms transformsr+matplotlib.unitsrDr getLoggerrA_logrQArtistInspectorrH_line_inspector get_setters_line_param_namesaliasdrXr{r_line_param_aliasesrArtistr rrrr+r7rCrEr)drbs00rirsN"##!!#+!w""*'))&--8#//1.=.D.D.K.K.MNtDG}N%69L%LN!!4N@;7>>@;F :+D:+z:+D:+z&$&$R++Ds$7>>s$l7<]D]@bDbCPONs 5E E