gL ibdZddlmZddlmZddlZddlZddlmZddl m Z ddl m cm ZddlZddlmZmZmZmZmZddlmZddlmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ejJd Z&ejJd Z'ejPd Z)ejPd Z*Gd dZ+y)z Test cases for Series.plot )datetime)chainN)is_platform_linux)np_version_gte1p24) DataFrameSeries date_range period_rangeplotting) _check_ax_scales_check_axes_shape _check_colors_check_grid_settings_check_has_errorbars_check_legend_labels_check_plot_works_check_text_labels_check_ticks_props_unpack_cycler get_y_axis matplotlibzmatplotlib.pyplotczttjdtjt dddS)N dtype 2020-01-01periodstsindexname)rnparangefloat64r g/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/tests/plotting/test_series.pyrr's.  "BJJ'r2  r'c ttdtjdtdDcgc]}d| c}Scc}w)Nseriesi_)rr"r!)rranger#r%)is r(r+r+0s9  b (USUY:WRs8:W :Ws AceZdZejj ejj dddiddigdZejj dZejj ejj dd d id d igd d idd igdd id d dggdZ ejj dZ ejj dZ dZ ejj ddddejdejdddgdZdZd Zejj did!d"id!d#igd$Zd%Zd&Zejj did'd igd(Zd)Zd*Zd+Zd,Zd-Zd.Zd/Zd0Zd1Zd2Z d3Z!ejj d4d5e"d6d78gd9Z#d:Z$d;Z%ejjMe'xre(dd?d@gdAZ)ejjMe'xre(dd]Z?ejj d^d_d`gd5d`gd5e@jd`gdae@jdbdcd`ggddZCdeZDdfZEdgZFejjMdhidjZGejj deHjjeHjjzdkZLejj deHjjeHjjzdlZMejj deHjjdmZNejj deHjjdnZOejj deHjjdoZPdpZQdqZRdrZSejj ejj dddgejj dseTe@je@jjdtjdue@je@jjdtjdueYe@je@jjdtjdueZe@je@jjdtjdvdwdxgygdzZ[ejj d{Z\ejj ejj dseTe@je@jjdtjd|eZe@je@jjdtjd}dwdxgygd~Z]ejj dZ^ejj dZ_ejj dZ`ejj dZaejj dZbejj dgddZcdZddZedZfdZgdZhdZidZjejjMdidZkejj dddgdZldZmdZnejj dgdgdfgdgdfgdZodZpejj dgdejj dgddZqejj d4erjddtderjderjdtggdZudZvejj dZwy5)TestSeriesPlotskwargslabelfoo use_indexFc0t|jfi|yNrplot)selfrr1s r( test_plotzTestSeriesPlots.test_plot8s "'',V,r'cLt|jd}t|dy)Nr)rotxrot)rr8r)r9raxess r(test_plot_tick_propsz$TestSeriesPlots.test_plot_tick_props=s a04a(r'zscale, exp_scalelogyTyaxisloglogxxaxisloglog)rErBcLt|jfddi|}t|fi|y)Nstyle.)rr8r )r9rscale exp_scaleaxs r(test_plot_scalesz TestSeriesPlots.test_plot_scalesBs)rww ;c ;U ;)y)r'cHt|ddjjyNr)rr8barr9rs r(test_plot_ts_barz TestSeriesPlots.test_plot_ts_barOs"Sb',,**+r'cFt|jjdy)NFstacked)rr8arearQs r(test_plot_ts_area_stackedz)TestSeriesPlots.test_plot_ts_area_stackedSs"'',,6r'cnttdtdd}t|jy)Nrr)rr-r rr8)r9sers r(test_plot_iseriesz!TestSeriesPlots.test_plot_iseriesWs%U1X|L!DE#((#r'kindlinerPbarhkdescipy)markshistboxc8t|ddj|y)NrYr\r7)r9r+r\s r(test_plot_series_kindsz&TestSeriesPlots.test_plot_series_kinds[s &!*//5r'cHt|ddjjyrO)rr8r^r9r+s r(test_plot_series_barhz%TestSeriesPlots.test_plot_series_barhis&"+**//0r'ctttjj dj dj jd}t|jdgdgy)Nrblackcolorr facecolors) rrr#random default_rngstandard_normalr8rPrpatches)r9rLs r(test_plot_series_bar_axz'TestSeriesPlots.test_plot_series_bar_axlsU  299((+;;B? @ E E I IQX  rzz!}o7)288V,"qIr'cd}tjj|}tjj\}}t gdj ||tjj|k(sJy)Nzaxes.prop_cyclerxrkrL)rrrcParamsrzrr8)r9keycolorsrrLs r(test_dont_modify_rcParamsz)TestSeriesPlots.test_dont_modify_rcParamssd$$S) ##%2y"%,,S1111r' secondary_yc4tjj\}}|jdd|i|}|j \}}|j }||dj dddksJ||dj dddk\sJy)NrLrForigrwr&)rrrzr8get_xlim get_linesget_data)r9rr1rrLxminxmaxliness r(test_ts_line_limz TestSeriesPlots.test_ts_line_lims ##%2 RWW % %f %[[] d uQx((e(4Q7::::uQx((e(4Q7;;;;r'c4tjj\}}|jj d|}|j \}}|j djdd}||dksJ||dk\sJt|dy)NF)rUrLrrrwr= rrrzr8rVrrrrr9rrrLrrr]s r(test_ts_area_limz TestSeriesPlots.test_ts_area_lims ##%2 WW\\%B\ /[[] d||~a ))u)5a8tAwtBx2A&r'c6tjj\}}|jj dd|}|j \}}|j djdd}||dksJ||dk\sJt|dy) NFTrUx_compatrLrrrwr=rrs r(test_ts_area_lim_xcompatz(TestSeriesPlots.test_ts_area_lim_xcompats ##%2 WW\\%$2\ >[[] d||~a ))u)5a8tAwtBx2B'r'c|j}|jdjd|_tj j \}}|jjdd|}|j\}}|jdjdd}||dksJ||dk\sJt|d y) NGMTCETFTrrrrwr= copy tz_localize tz_convertr!rrrzr8rVrrrrr9rtz_tsrrLrrr]s r(test_ts_tz_area_lim_xcompatz+TestSeriesPlots.test_ts_tz_area_lim_xcompats ''.99%@  ##%2 ZZ__UTb_ A[[] d||~a ))u)5a8tAwtBx2A&r'c|j}|jdjd|_tj j \}}|jjdd|}|j\}}|jdjdd}||dksJ||dk\sJt|d y) NrrFT)rUrrLrrrwr=rrs r('test_ts_tz_area_lim_xcompat_secondary_yz7TestSeriesPlots.test_ts_tz_area_lim_xcompat_secondary_ys ''.99%@  ##%2 ZZ__U_ D[[] d||~a ))u)5a8tAwtBx2A&r'cbtjjddd\}\}}t|j |dt|j |dt |j ||sJt |j ||sJtj|y)NrxrkT)shareyrV)rLr\) rrrzabsr8rjoinedpltclose)r9rfigax1ax2s r(test_area_sharey_dont_overwritez/TestSeriesPlots.test_area_sharey_dont_overwrites**--a4-@Zc3 B & ) B & )#%%c3///#%%c3/// #r'ctddg}tjj\}}|j dd|}t |dgtjj dy)NrxrkLABELT)r2legendrLlabelsallrrrrzr8rrr9srrLs r( test_labelzTestSeriesPlots.test_labelsW Aq6N ##%2 VV'$2V 6R 2 r'ctddg}tjj\}}|j d|}t |dgtjj dy)NrxrkTrrLrrrrs r(test_label_nonezTestSeriesPlots.test_label_nonesU Aq6N ##%2 VV4BV 'R- r'ctddgd}tjj\}}|j d|}t |dgtjj dy) NrxrkNAMEr"Trrrrrs r(test_label_ser_namez#TestSeriesPlots.test_label_ser_namesX Aq6 ' ##%2 VV4BV 'R1 r'ctddgd}tjj\}}|j dd|}t |dgtjj d y) NrxrkrrTrrr2rLrrrrs r(test_label_ser_name_overridez,TestSeriesPlots.test_label_ser_name_overridesZ Aq6 ' ##%2 VV4w2V 6R 2 r'c*tddgd}tjj\}}|j dd|}|j J|j t|dgtjjd y) NrxrkrrFrrrr) rrrrzr8 get_legendrrrrs r(&test_label_ser_name_override_dont_drawz6TestSeriesPlots.test_label_ser_name_override_dont_drawsu Aq6 ' ##%2 VV5BV 7}}&&& R 2 r'ctgd}t|jdd}tjt |5t|jdddy#1swYyxYw)N)FFTT) include_boolno numeric data to plotmatch)rrr8pytestraises TypeError)r9rmsgs r( test_booleanzTestSeriesPlots.test_booleansO ' (!&&t4' ]]9C 0 & aff % & & &s A!!A*r!Nrrcddtjdg}t||}t|j}|j dj }tjgdtj}tjtj|jd|tj|jtjgdtjgd tj}t|jd }tj|j dj |t|jj}tj|j dj |t|jjd }tj|j dj |y) Nrxrkrr!rrr)FFTF)rxrkrrTrTF)r#nanrrr8r get_ydataarrayr%tmassert_numpy_array_equaldeletedatamaskrV)r9r!valuesdrLmaskedexpexpecteds r(test_line_area_nan_seriesz)TestSeriesPlots.test_line_area_nan_seriessBQ" 6 ' qvv &!&&(hhy 3 ##BIIfkk1$=sC ##FKK:U1VW88L ; qvvt 4 ##BHHQK$9$9$;XF qvv{{ + ##BHHQK$9$9$;XF qvv{{E : ##BHHQK$9$9$;XFr'ctgdgd}d|j_tjj \}}|j d|}|j}|dk(sJyNrabcrz The IndexFr4rLr)rr!r"rrrzr8 get_xlabel)r9rrrLr2s r(test_line_use_index_falsez)TestSeriesPlots.test_line_use_index_falsesX 9O 4"  ##%2 VVeV + {{r'ctgdgd}d|j_tjj \}}|j jd|}|j}|dk(sJyr) rr!r"rrrzr8rPr)r9rrrLrlabel2s r("test_line_use_index_false_diff_varz2TestSeriesPlots.test_line_use_index_false_diff_vars] 9O 4"  ##%2ffjj5Rj0!||r'zWeird rounding problems)reasonstrictz axis, meth)rBrP)rEr^c"tjgd}tjj \}}t t ddgj|d|}tjt ||j|y)N)皙??$@gY@g@@g@iT)rCrL) r#rrrrzgetattrrr8rr get_ticklocs)r9axismethrrrLs r( test_bar_logzTestSeriesPlots.test_bar_logsm88;< ##%2 3WVS#J',,d 3 D ##GB$5$B$B$DhOr'zaxis, kind, res_meth)rBrPget_ylim)rEr^rctjgd}tjj \}}t gdj d||}d}d}t||} tj| d|tj| d|tjt||j|y) N)gh㈵>g-C6?MbP?{Gz?rrr)rrrT)rCr\rLg!,NJ?gЄ-??rrx) r#rrrrzrr8rrassert_almost_equalrr) r9rr\res_methrrrLyminymaxress r(test_bar_log_kind_barz%TestSeriesPlots.test_bar_log_kind_bar$s88DE ##%2 & ' , ,DR , H$"#gb(#% s1vt, s1vt, ##GB$5$B$B$DhOr'ctgdgd}tjj\}}|jj d|}t |jgdy)NrxrkrrrrrrrFr)0123)rrrrzr8rPrget_xticklabels)r9dfrrLs r(test_bar_ignore_indexz%TestSeriesPlots.test_bar_ignore_index:sO L(< = ##%2 WW[[5R[ 02--/1EFr'ctgd}|jjgd}|jDcgc]}|j }}gd}||k(sJycc}w)Nr)redbluerrrm)rrrrrrrrr)rr8rPrt get_facecolor)r9rrLpresultrs r(test_bar_user_colorsz$TestSeriesPlots.test_bar_user_colors@s[ <  VVZZq!ABBBBryyq!2!2!2!>q!ABBBBr'c&ttjjdj ddgdd}t |j j}t|j|j|jdk(sJy)NrkrxrYrrrreYLABELr ) rr#rqrrintegersrr8piertextsr! get_ylabelr9r+rLs r(test_pie_serieszTestSeriesPlots.test_pie_seriesrsm II ! !! $ - -a 3+  v{{ /288V\\2}}(***r'cttjjdj ddgdd}t |j jd}t|jdgdzy) NrkrxrYr=r?r rr) rr#rqrrr@rr8rArrBrDs r(test_pie_series_no_labelz(TestSeriesPlots.test_pie_series_no_label~s[ II ! !! $ - -a 3+  v{{t <288bTAX.r'cttjjdj ddgdd}gd}t |j j|}gd }t|j| y) NrkrxrYr=r?r )rgrr)rIrJrrIrJro) rr#rqrrr@rr8rArrt)r9r+ color_argsrLcolor_expecteds r()test_pie_series_less_colors_than_elementsz9TestSeriesPlots.test_pie_series_less_colors_than_elementss_ II ! !! $ - -a 3+  % v{{z B2bjj^>#q( (( )FsDctgdgd}tjtd5|jj dddy#1swYyxYw)N)rxrkrrrwr=rz&pie plot doesn't allow negative valuesr)rrr ValueErrorr8rArhs r(test_pie_series_negative_raisesz/TestSeriesPlots.test_pie_series_negative_raisessB(0IJ ]]:-U V  KKOO    s AActddtjdggdd}t|jj }t |jgdy)Nrxrkrrr?r )rrrr)rr#rrr8rArrBrDs r(test_pie_series_nanz#TestSeriesPlots.test_pie_series_nans?Arvvq)1EHU v{{ /288%89r'c(tdtjddg}tjj \}}|j jd|}gd}|jDcgc]}|j}}||k(sJycc}w)NrxTr)rrrr) rr#rrrrzr8rArBget_text)r9rrrLrxr!s r( test_pie_nanzTestSeriesPlots.test_pie_nansz Arvvq!$ % ##%2 VVZZtZ +&(*11!**,11!!!2s.Bc:ttjjdj dt d}t tjjdj dd}tjj\}}|j|}|jd d | t|gd  |jjsJ|jjjsJy) NrkrrabccolumnsrrmrrTrrrLrrr x (right)rrr#rqrrrsr^rrrrzr8r get_yaxis get_visibleright_axr9rrrrLs r(test_df_series_secondary_legendz/TestSeriesPlots.test_df_series_secondary_legends  II ! !! $ 4 4W =tE{  299((+;;B?c J ##%2 WWW^ d4 R(DE||~))+++{{$$&22444r'c:ttjjdj dt d}t tjjdj dd}tjj\}}|j|}|j|d d t|gd  |jjsJ|jjjsJy) NrkrprqrrrrmrrTrLrrrurrwr{s r()test_df_series_secondary_legend_with_axesz9TestSeriesPlots.test_df_series_secondary_legend_with_axess  II ! !! $ 4 4W =tE{  299((+;;B?c J ##%2 WWW^ "Tt4 R(DE||~))+++{{$$&22444r'cTttjjdj dt d}t tjjdj dd}tjj\}}|jd| }|jdd| gd }t|j| |jjjrJ|jjsJy) NrkrprqrrrrmrTrrLrtz a (right)z b (right)z c (right)rvrrr#rqrrrsr^rrrrzr8rleft_axrxryr9rrrrLrs r($test_df_series_secondary_legend_bothz4TestSeriesPlots.test_df_series_secondary_legend_boths  II ! !! $ 4 4W =tE{  299((+;;B?c J ##%2 WW"W - d4HRZZ9::'')55777||~))+++r'cRttjjdj dt d}t tjjdj dd}tjj\}}|jd| }|j|dd gd }t|j||jjjrJ|jjsJy) NrkrprqrrrrmrTrr~rrrs r(.test_df_series_secondary_legend_both_with_axisz>TestSeriesPlots.test_df_series_secondary_legend_both_with_axiss  II ! !! $ 4 4W =tE{  299((+;;B?c J ##%2 WW"W - "Tt4HRZZ2::'')55777||~))+++r'cTttjjdj dt d}t tjjdj dd}tjj\}}|jdd | }|j|dd gd }t|j||jjjrJ|jjsJy) NrkrprqrrrrmrTF)r mark_rightrLr~rurrs r(0test_df_series_secondary_legend_both_with_axis_2z@TestSeriesPlots.test_df_series_secondary_legend_both_with_axis_2s  II ! !! $ 4 4W =tE{  299((+;;B?c J ##%2 WW%BW ? "Tt40RZZ2::'')55777||~))+++r'zinput_logy, expected_scale)TrC)symsymlogc~ttjjdj d}ttjjdj d}|j |}|j d|}|j |k(sJ|j |k(sJy)Nrkr\)rAT)rrA)rr#rqrrrsr8 get_yscale)r9 input_logyexpected_scales1s2rrs r(test_secondary_logyz#TestSeriesPlots.test_secondary_logys BII))!,<111~~>111r'c@ttjjdj d}t j j\}}d}tjt|5|jdd|dddy#1swYyxYw)NrkzCannot pass 'style' string with a color symbol and 'color' keyword argument. Please use one or the other or pass 'style' without a color symbolrzk--k)rHrnrL) rr#rqrrrsrrrzrrrgr8)r9rmrrLrs r()test_plot_fails_with_dupe_color_and_stylez9TestSeriesPlots.test_plot_fails_with_dupe_color_and_style's} 299((+;;A> ? ##%2  ]]:S 1 2 FFcbF 1 2 2 2s 6BBzbw_method, indscottr*?r\crtjdt|jj||y)Nr` bw_methodind)r importorskiprr8r_)r9rrrs r(test_kde_kwargszTestSeriesPlots.test_kde_kwargs2s& G$"''++Dr'ctjdtjddd}t |j j d|y)Nr`rr\r*rr)rrr#linspacerr8density)r9r sample_pointss r(test_density_kwargsz#TestSeriesPlots.test_density_kwargs?s6G$ D#r2 "''//SmLr'c>tjdtjj \}}t j ddd}|jjdd||}t|d t|jjd y) Nr`rr\r*Tr)rArrrLrCrBDensity) rrrrrzr#rr8r_r rrB get_label)r9rrrLrs r(test_kde_kwargs_check_axesz*TestSeriesPlots.test_kde_kwargs_check_axesDssG$ ##%2 D#r2 WW[[dc}[ L5)288--/;r'cztjdttjj dj d}tj|d<t|jj}ttj|jdjsJy)Nr`rk2)sizer)rrrr#rqrruniformrrr8r_anyisnanr get_xdata)r9rr?s r(test_kde_missing_valsz%TestSeriesPlots.test_kde_missing_valsLsG$ 299((+333< =vv! ,BHHTZZ]44677888r'zApi changed in 3.6.0)rc:tjj\}}|jj d|}t |d|j }t||jg|j}t|dgt|zy)NT)rArLrCrr) rrrzr8rcr rrr"get_yticklabelsr2)r9rrrLxlabelsylabelss r(test_boxplot_seriesz#TestSeriesPlots.test_boxplot_seriesUsy ##%2 WW[[dr[ *5)$$&7RWWI.$$&7RD3w<$78r'ctjdttd}tj j \}}|j||tj jy)Nr`rr\rL) rrrr-rrrzr8rr9r\rrrLs r(test_kind_kwargzTestSeriesPlots.test_kind_kwarg_sV G$ 58  ##%2 DR  r'c tjdttd}tj j \}}t|j|tj jy)Nr`r) rrrr-rrrzrr8rrs r(test_kind_attrzTestSeriesPlots.test_kind_attrjsY G$ 58  ##%2 r'cttd}tjj \}}d}t j t|5|j||dddy#1swYyxYw)Nabcdrrr) rr^rrrzrrrr8r9r\rrrLrs r(test_invalid_plot_dataz&TestSeriesPlots.test_invalid_plot_dataus^ 4<  ##%2' ]]9C 0 % FFF $ % % %s A00A9ctjdttdt}t |j |y)Nr`rrre)rrrr-objectrr8)r9r\rs r(test_valid_object_plotz&TestSeriesPlots.test_valid_object_plot}s.G$ 59F +!&&t,r'ctgd}tjj\}}d}t j t |5|j||dddy#1swYyxYw)N)rrrrkrrr)rrrrzrrrr8rs r( test_partially_invalid_plot_dataz0TestSeriesPlots.test_partially_invalid_plot_datas[ % & ##%2' ]]9C 0 % FFF $ % % %s A))A2ctddg}tjtd5|j ddddy#1swYyxYw)Nrxrkz%invalid_kind is not a valid plot kindr invalid_kindre)rrrrgr8r9rs r(test_invalid_kindz!TestSeriesPlots.test_invalid_kindsA Aq6N ]]:-T U ( FFF ' ( ( (s AActdd}tdd}|j|}tjj dj |j }t||}t|jy)Nz1/1/2009rrz1/2/2009rkr) r appendr#rqrrrsrrrr8)r9dr1dr2r!rrs r(test_dup_datetime_index_plotz,TestSeriesPlots.test_dup_datetime_index_plotsbQ/Q/ 3&&q)99%**E 6 '!&&!r'cttjdd}tjj djd}|j ||}tj |jdjDcgc]}|jdddfc}}|jtjddgz|jjddz}tj||d t!|d }t#j$t&| 5|j tjj djd  dddycc}w#1swYyxYw)Nrrmrrk)rkr)yerrxerrrxrwz?Asymmetrical error bars should be provided with the shape \(2, z\)r)rkr.r)rr#r$rqrrr8vstack collections get_pathsverticesTrto_numpyreshaperrr2rrrg)r9rerrrLr.r!rrs r(test_errorbar_asymmetricalz*TestSeriesPlots.test_errorbar_asymmetricals9 299R=s +ii##A&--g6 VV3V 'bnnQ6G6Q6Q6STAJJq!t,TUEEBHHb!W--1E1Eb!1LL ##FH5 $$'F83 0 ]]:S 1 B FF --a077@F A B BU B BsE>6?FF rrkr)rrkrmyrrcttjdd}t|j||}t |ddy)Nrrmr)rr\rrxrr)rr#r$rr8r)r9r\rrrLs r(test_errorbar_plotz"TestSeriesPlots.test_errorbar_plots6 299R=s + qvvDt <Raa0r'cttjdd}tjtjj dj d}t|j|}t|ddy) Nrrmrrk)rrxrr) rr#r$rrqrrrsrr8r)r9rs_errrLs r(test_errorbar_plot_yerr_0z)TestSeriesPlots.test_errorbar_plot_yerr_0sZ 299R=s +ryy,,Q/??CD qvvE 2Raa0r'r/)r/rkctddd}ttjd|d}||_t |j |}t|d d y) Nr,r0ME)freqr/rmr rrrxr)r rr#r$r!rr8r)r9rixrrLs r(test_errorbar_plot_tsz%TestSeriesPlots.test_errorbar_plot_tssK JT : BIIbM# 6 rwwT 2Raa0r'cttjdd}tjt 5|j tjddddy#1swYyxYw)Nrrmrr.r)rr#r$rexternal_error_raisedrgr8rs r(%test_errorbar_plot_invalid_yerr_shapez5TestSeriesPlots.test_errorbar_plot_invalid_yerr_shapesO 299R=s +  % %j 1 ' FF " F & ' ' 's &A))A2cttjdd}dgdz}tjt 5|j |dddy#1swYyxYw)Nrrmrzzzr)rr#r$rrrr8)r9rrs r(test_errorbar_plot_invalid_yerrz/TestSeriesPlots.test_errorbar_plot_invalid_yerrsR 299R=s +"   % %i 0  FFF    s AA%c2t|jdy)NTtabler7rhs r(test_table_truezTestSeriesPlots.test_table_trues&++T2r'c2t|j|y)Nrr7rhs r(test_table_selfzTestSeriesPlots.test_table_selfs&++V4r'ctjdttgdtj j tj jzy)Nr`r)rrrrr PlotAccessor _series_kinds _common_kinds)r9s r(test_series_grid_settingsz)TestSeriesPlots.test_series_grid_settingssB G$ 9   ! ! / /(2G2G2U2U U r'r)rIrgreenz#FF0000cddlm}|d|}||gk(sJ|d|g}||gk(sJ|d|}||gdzk(sJ|d|g}||gdzk(sJy)Nrget_standard_colorsrxrmr)!pandas.plotting._matplotlib.styler)r9rrr!s r(test_standard_colorsz$TestSeriesPlots.test_standard_colorss}I$Qa0!}}$Qqc2!}}$Qa0!q   $Qqc2!q   r'cddlm}ddlm}|jD]R}|d|}||gk(sJ|d|g}||gk(sJ|d|}||gdzk(sJ|d|g}||gdzk(rRJ|j jD]R}|d|}||gk(sJ|d|g}||gk(sJ|d|}||gdzk(sJ|d|g}||gdzk(rRJy)NrrKrrx) num_colorsrnr)rrrrcnamesColorConverter)r9rrrr!s r(test_standard_colors_allz(TestSeriesPlots.test_standard_colors_alls*%I %A(AQ?FaS= =(AaSAFaS= =(AQ?FaS1W$ $$(AaSAFaS1W$ $$ %&&-- %A(AQ?FaS= =(AaSAFaS= =(AQ?FaS1W$ $$(AaSAFaS1W$ $$ %r'ctjj\}}tt j ddzj d|}t|jdgy)Nr/rxrrnrL linecolors) rrrzrr#r$r8rrr9rrLs r(test_series_plot_color_kwargsz-TestSeriesPlots.test_series_plot_color_kwargs(sQ ##%2 BIIbMA% & + +'b + Ablln';r'ctjj\}}tt j ddzt ddjd|}t|jdgy) Nr/rxr,rrrrr) rrrzrr#r$r r8rrr s r("test_time_series_plot_color_kwargsz2TestSeriesPlots.test_time_series_plot_color_kwargs.sb ##%2 BIIbMA%Z B-O P U UbV  blln';r'cPddl}t|j}tdd}t t j dd|}d}|jj\}}t|D]}|j| }t|j|d| y) Nrr,r/rrx rrrr) rrrr rr#r$rrzr-r8rr) r9r def_colorsr!rncolorsrrLr.s r(-test_time_series_plot_color_with_empty_kwargsz=TestSeriesPlots.test_time_series_plot_color_with_empty_kwargs6s #CLL1 :r2 299Q#5 1 ##%2w A2B bllnHW1EFr'c TttjdtdDcgc]}d|d c}}tj j \}}|jgd|}dDcgc]}d|d }}t|j|ycc}wcc}w)NrP02dr)rrrYr-)xticksrL) rr#r$r-rrrzr8rr)r9r.rrrLrs r(test_xticklabelsz TestSeriesPlots.test_xticklabelsDs 299R=eBi(H1QsG(H I ##%2 VV"a'''||~a 4>>#$)))4>>#$)))r'ctgd}tjtd5|j dddy#1swYyxYw)Nrrr)rrrrr8)r9rs r(test_plot_no_numeric_dataz)TestSeriesPlots.test_plot_no_numeric_datas9 O $ ]]9,E F  GGI   s AA z data, indexr)rrkrxr)rrr*r)iviiict||}|jd}|j}t|jdDcgc]}|j j }}||k(sJycc}w)N)rr!rPrec6|jjSr6)get_bboxr)patchs r(z1TestSeriesPlots.test_plot_order..senn>N>S>Sr')r)rr8tolistsortedrtr5r )r9rr!rZrLrr6r!s r(test_plot_orderzTestSeriesPlots.test_plot_ordersx$e, XX5X !::<  0ST  NN  ! !  6!!!  s !A5ctddg}|jdd}|jdjdk(sJy)NrxrkrC3)rHrnr)rr8r get_color)r9rrLs r(test_style_single_okz$TestSeriesPlots.test_style_single_oks@ Aq6N VV#TV *xx{$$&$...r'z index_name, old_label, new_label))Nrnew)oldr@r?)Nrr)r]rVrPr^rbctgd}||j_|j|}|dk(r*|j dk(sJ|j |k(s[J|dk(r*|j dk(sJ|j dk(s,J|j dk(sJ|j |k(sJ|j|||}|j |k(sJ|j |k(sJy)Nrrer^rrb Frequency)r\ylabelxlabel)rr!r"r8rrC)r9r\ index_name old_label new_labelrZrLs r(test_xlabel_ylabel_seriesz)TestSeriesPlots.test_xlabel_ylabel_seriess\"# XX4X  6>==?b( ((==?i/ // V^==?b( ((==?k1 11==?b( ((==?i/ //XX4 )X D}})+++}})+++r'rrS)rrrrx)dayscpd}tddg|j|}|jdk(sJy)N)rrxrxrkr)xlim)rr8r)r9r!r+rLs r(test_timedelta_indexz$TestSeriesPlots.test_timedelta_indexs; QF% ( - -E - ;{{}&&&r'ctgd}|jd}ttjj dd}t |j|y)Nrrmrxr)rr8rrrrrr)r9r+rLrs r(test_series_none_colorz&TestSeriesPlots.test_series_none_colorsG " [[t[ $!#**"5"56r:blln:r'cxtjd5|j}dddy#1swYyxYw)NF)rassert_produces_warningr8)r9rrs r(test_plot_no_warningz$TestSeriesPlots.test_plot_no_warnings2 ' ' .  A   s09)x__name__ __module__ __qualname__rmarkslow parametrizer:r@rMrRrWr[paramtd skip_if_norfrirur}rrrrrrrrrrrrrrr rrrxfailrrrrrr"r'r)r7r;rErGrNrWrerhrjrnr|rrrrrrr#int_rrrrrrr rrrrrrrrrrrrrrqrrrsr^rrrrrrrrrrrr r rrrr#r)r,r0r2r:r>rHr!timedelta_range TimedeltarLrNrQr&r'r(r0r07s  [[ [[X%(8;:N'OP-Q- [[)) [[ [[d^gu- .d^gu- . ? @ ** [[,, [[77$ [[    FLLmbmmG&< =     6 61=  [[XXw,?(GAT'UV9W9 J2 [[X]D,A'BC<D<'( ' '      & [[WtZ a-P&QRGSG$ [[202(  [[\,<>O+PQPR  P [[202(  [[ %'DE P   PG ")* ( C +/ = 9)  : "5"5 ,","," [[$}6G&H 2 2 2 [[ bM 2J 72772;  +"++dC, -  EEM <9 [[45969 [[++h.C.C.Q.QQ  [[++h.C.C.Q.QQ  [[VX%:%:%H%HI%J% [[VX%:%:%H%HI-J-  [[VX%:%:%H%HI%J%( "B$ [[ [[Vfe_5 [[ 6266"))//2BB2FG H BFF299((+;;B? @  --a0@@DE F ryy,,Q/??HIc     1 61  [[11  [[ [[ 6266"))//2BB2FG H ryy,,Q/??HIc    1 1 [[''  [[  [[33 [[55 [[   [[S"BC !D !%B< < G6: " [[= 3  3 [[Vff%56 7 *  [[ < ( 7 8  " "/  [[*B [[V%LM,N  ,, [[ B  Q < R\\q !<2<rls" +2))    f,'f-. bbr'