rL idZddlmZddlZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZddlmZddlmZddlmZGddej2ZGd d ej6ZGd d ej:ZGd de Zeee dgddZ e dgdejBdk(rdnddZ"y)z) Testing that skewed Axes properly work. ) ExitStackN)image_comparison)Axes)register_projectionc$eZdZfdZdZxZS) SkewXTickct5}|j|j|j|j|j fD],}|j |j|j.tj|jj|j}tj|jj|j}|jj|jjxr||jj|jjxr||jj|jjxr||j j|j jxr|t|A|dddy#1swYyxYwN)rgridline tick1line tick2linelabel1label2callback set_visible get_visible transformsinterval_containsaxes lower_xlimget_loc upper_xlimsuperdraw)selfrendererstackartist needs_lower needs_upper __class__s `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/tests/test_skew.pyrzSkewXTick.drawsc [ #E==$..$..;; 5 Iv1163E3E3GH I%66 $$dlln6K$66 $$dlln6K NN & &**,< > KK # # '')9k ; NN & &**,< > KK # # '')9k ; GL "! # # #s GGG"cJ|jjjSr )rxaxisget_view_intervalrs r"r%zSkewXTick.get_view_interval*syy0022)__name__ __module__ __qualname__rr% __classcell__r!s@r"rrs #&3r'rceZdZdZdZy) SkewXAxisc2t|jd|S)N)major)rr)rr0s r" _get_tickzSkewXAxis._get_tick1sD66r'cf|jjd|jjdfS)Nr)rrrr&s r"r%zSkewXAxis.get_view_interval4s+yy##A& (<(r4r'r"r6r6;s-r'r6cNeZdZdZdZdZfdZedZedZ xZ S) SkewXAxesskewxct||_|jjj |j|jj j |jt j||_|jjj |j|jjj |jyr ) r.r$spinesr8 register_axisbottommaxisYAxisyaxisleftrightr&s r" _init_axiszSkewXAxes._init_axisLst_  %%djj1 ((4[[&  &&tzz2 '' 3r'ctj|dtjj|dtjj|dtjj|dd}|S)Nr8rErIrJ)r8rErIrJ)r6 linear_spinemspinesSpine)rrCs r"_gen_axes_spineszSkewXAxes._gen_axes_spinesUs]"//e<#MM66tXF!--44T6B"==55dGDF r'cd}t||j|jt j j |dzz|_|j|jz|_ t j|j|jzt jt j j |dz|jz|_ y)z This is called once when the plot is created to set up all the transforms for the data, text and grids. rN) r_set_lim_and_transforms transScale transLimitsrAffine2Dskew_degtransDataToAxes transAxes transDatablended_transform_factoryIdentityTransform_xaxis_transform)rrotr!s r"rSz!SkewXAxes._set_lim_and_transforms\s  ')!%!%!1!1!+!4!4!6!?!?Q!G"H!I -->",!E!E OOd.. .  ( ( *",    ! * *3 2"37;nn!Er'cB|jjjSr )rviewLim intervalxr&s r"rzSkewXAxes.lower_xlimysyy  ***r'crddgddgg}|jjj|dddfS)Ngg?r)rXinverted transformr<s r"rzSkewXAxes.upper_xlim}s=Bx"b"##,,.88=adCCr') r(r)r*namerKrPrSpropertyrrr+r,s@r"r@r@GsD D4E:++DDr'r@z skew_axes.pngT) remove_textctj}|jdddd}|jdd|j dd|j d|j dd y) Nr3rA) projectioni2Trb)color)pltfigure add_subplotset_xlimset_ylimgridaxvline)figaxs r"test_set_line_coll_dash_imagervs\ **,C AqW 5BKKRKKCGGDMJJqJr'zskew_rects.pngx86_64g;On?)rgtolc ~tjddddd\}}|j}tt j gdd}|dj d d g|djd d g|djd d t||D]\}\}}d |zd |z}}tjj||}|jd|d|d|jtj ddgdd||j"zddtj$dddddy)NT)r{)sharexshareyfigsize)rr3)repeatrrrequal)share-zSkew of z in X and z in Yrg?coral)rdalpha facecolorg{Gz?gGz?)wspacerIrJrEr8)rmsubplotsflatlist itertoolsproductrprq set_aspectziprrVrW set_title add_patchmpatch RectanglerZsubplots_adjust) fixr rotationsruxrotsyrotsxdegydegts r"test_skew_rectanglers8 Q$tVLIC 99DY&&'8CDIGb!WGb!WGwd+!$ 2ENUE%Zed    ! * *4 6 xvZvU;< V%%r2h101BLL0@,/7D E Eqt4$Or')#__doc__ contextlibrrplatformmatplotlib.pyplotpyplotrmmatplotlib.testing.decoratorsrmatplotlib.axesrmatplotlib.transformsrmatplotlib.axisaxisrFmatplotlib.spinesrCrNmatplotlib.patchespatchesrmatplotlib.projectionsrXTickrXAxisr.rOr6r@rvmachinerr4r'r"rs!: *##6 3 34@ @- -9D9D|I?#67#$$+8++-9auFPFPr'