o
    dGx                     @   s   d Z ddlmZ ddlmZ ddlZddlZddlmZ ddl	m
Z
 ddlm  mZ ddlZddlmZmZmZmZ ddlmZ ddlmZmZ ejd	d
 Zejdd Zejdd ZejG dd deZ dS )z Test cases for Series.plot     )datetime)chainN)is_platform_linux)np_version_gte1p24)	DataFrameSeries
date_rangeplotting)TestPlotBase_check_plot_worksc                   C      t jddS )Ntsname)tmmakeTimeSeries r   r   f/var/www/html/visualizacion-main/env/lib/python3.10/site-packages/pandas/tests/plotting/test_series.pyr         r   c                   C   r   )Nseriesr   )r   makeStringSeriesr   r   r   r   r      r   r   c                   C   r   )Niseriesr   )r   makePeriodSeriesr   r   r   r   r   $   r   r   c                
   @   s|  e Zd Zejjdd Zdd Zejddddej	d	e
jd
ddgdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zejd#d$ejd%d&gd'd( Zd)d* Zejjeoke d+d,d-d.d/ Zd0d1 Zd2d3 Z d4d5 Z!d6d7 Z"d8d9 Z#d:d; Z$d<d= Z%d>d? Z&ejd@dAdBgdCdD Z'dEdF Z(e
jdGdH Z)e
jdIdJ Z*ejjdKdLdMdN Z+e
jejde,j-j.e,j-j/ dOdP Z0ejde,j-j.dQdR Z1e
jejde,j-j.dSdT Z2ejde,j-j.dUdV Z3dWdX Z4dYdZ Z5d[d\ Z6ejjd]d^ Z7ejjd_d` Z8ejje
jdadb Z9ejdcg dddedf Z:dgdh Z;didj Z<dkdl Z=dmdn Z>dodp Z?dqdr Z@dsdt ZAejjdudLdvdw ZBejdddxgdydz ZCd{d| ZDd}d~ ZEejdg dg dfg dg dfgdd ZFdd ZGejdg dejdg ddd ZHejd#eIjJddddeIjKddeIjKddggdd ZLd$S )TestSeriesPlotsc                 C   s   t |jdd t |jdd t |jdd}| j|dd t |jdd	d
}| j|dd t |jdd	d}| j|dd t |jdd	d}| j|ddd t |d d jj t |jjdd d S )Nfoo)labelF)	use_indexr   )rotxrot.T)stylelogylogyaxis)r!   logx)xaxis)r!   loglog)r'   r%   
   stacked)r   plot_check_ticks_props_check_ax_scalesbararea)selfr   axesaxr   r   r   	test_plot+   s   zTestSeriesPlots.test_plotc                 C   s   t |j d S Nr   r,   )r1   r   r   r   r   test_plot_iseries>   s   z!TestSeriesPlots.test_plot_iserieskindliner/   barhkde)markshistboxc                 C   s   t |d d j|d d S )N   r8   r6   )r1   r   r8   r   r   r   test_plot_series_kindsA   s   z&TestSeriesPlots.test_plot_series_kindsc                 C   s   t |d d jj d S )Nr)   )r   r,   r:   r1   r   r   r   r   test_plot_series_barhO   s   z%TestSeriesPlots.test_plot_series_barhc                 C   s8   t ttjdjjdd}| j|jd gdgd d S )Nr)   blackcolorr   
facecolors)	r   r   nprandomrandnr,   r/   _check_colorspatches)r1   r3   r   r   r   test_plot_series_bar_axR   s   z'TestSeriesPlots.test_plot_series_bar_axc                 C   sb   t |jdd}| j|ddd t |jddd}| j|ddd t |jddd}| j|ddd d S )	NT)subplots   rP   rP   )axes_numlayout)rP   )rO   rS   )rP   rT   )r   r,   _check_axes_shape)r1   r   r3   r   r   r   test_plot_6951V   s   zTestSeriesPlots.test_plot_6951c                 C   sB   | j  \}}|jdd|d}| |jd | j|dddd d S )NTest)      )titlefigsizer3   rP   rQ   )rR   rS   r[   )pltrO   r,   _check_text_labelsrZ   rU   )r1   r   _r3   r   r   r   test_plot_figsize_and_title`   s   z+TestSeriesPlots.test_plot_figsize_and_titlec                 C   sJ   d}| j j| }| j  \}}tg dj|d || j j| ks#J d S )Nzaxes.prop_cyclerP         r3   )r\   rcParamsrO   r   r,   )r1   keycolorsr^   r3   r   r   r   test_dont_modify_rcParamsg   s
   z)TestSeriesPlots.test_dont_modify_rcParamsc                 C   s   | j  \}}|j|d}| \}}| }||d jddd d ks'J ||d jddd d ks7J t  |jd|d}| \}}| }||d jddd d ks\J ||d jddd d kslJ d S )Nrc   r   ForigrT   Tsecondary_yr3   )r\   rO   r,   get_xlim	get_linesget_datar   close)r1   r   figr3   xminxmaxlinesr   r   r   test_ts_line_limo   s      $z TestSeriesPlots.test_ts_line_limc                 C   s  | j  \}}|jjd|d}| \}}| d jddd }||d ks)J ||d ks1J | j|dd t	  | j  \}}|jjdd|d}| \}}| d jddd }||d ksfJ ||d ksnJ | j|d	d t	  |
 }|d
d|_| j  \}}|jjdd|d}| \}}| d jddd }||d ksJ ||d ksJ | j|dd t	  | j  \}}|jjdd|d}| \}}| d jddd }||d ksJ ||d ksJ | j|dd d S )NF)r+   r3   r   rh   rT   r   T)r+   x_compatr3      GMTCET)r+   rk   r3   )r\   rO   r,   r0   rl   rm   rn   r-   r   ro   copytz_localize
tz_convertindex)r1   r   r^   r3   rq   rr   r9   tz_tsr   r   r   test_ts_area_lim~   sB   z TestSeriesPlots.test_ts_area_limc                 C   sn   | j jdddd\}\}}t|j|dd t|j|dd | |||s*J | |||s5J d S )NrP   ra   T)shareyr0   )r3   r8   )r\   rO   absr,   
get_y_axisjoined)r1   r   rp   ax1ax2r   r   r   test_area_sharey_dont_overwrite   s
   z/TestSeriesPlots.test_area_sharey_dont_overwritec                 C   s8  t ddg}| j \}}|jdd|d}| j|dgd | j  | j \}}|jd|d}| j|dgd | j  d	|_| j \}}|jd|d}| j|d	gd | j  | j \}}|jdd|d
}| j|dgd | j  | j \}}|jdd|d
}| d u sJ |  | j|dgd d S )NrP   ra   LABELT)r   legendr3   labelsr   r3    NAME)r   r   r3   F)	r   r\   rO   r,   _check_legend_labelsro   r   
get_legendr   )r1   sr^   r3   r   r   r   
test_label   s.   



zTestSeriesPlots.test_labelc                 C   s\   t g d}t|jdd d}tjt|d t|j W d    d S 1 s'w   Y  d S )N)FFTT)include_boolno numeric data to plotmatch)r   r   r,   pytestraises	TypeError)r1   r   msgr   r   r   test_boolean   s   "zTestSeriesPlots.test_booleanr|   N   )kc                 C   s   ddt jdg}t||d}t|j}|jd  }t jg dt jd}t	
t |jd| t	
|jt g d t jg d	t jd}t|jd
d}t	
|jd  | t|jj}t	
|jd  | t|jjdd}t	
|jd  | d S )NrP   ra   rb   r|   r   r`   dtype)FFTF)rP   ra   r   rb   Tr*   F)rI   nanr   r   r,   rs   	get_ydataarrayfloat64r   assert_numpy_array_equaldeletedatamaskr0   )r1   r|   valuesdr3   maskedexpexpectedr   r   r   test_line_area_nan_series   s   
z)TestSeriesPlots.test_line_area_nan_seriesc                 C   s   t g dg dd}d|j_| j \}}|jd|d}| }|dks&J | j \}}|jjd|d}| }|dks?J d S )Nr`   abcr   z	The IndexFr   r3   r   )r   r|   r   r\   rO   r,   
get_xlabelr/   )r1   r   r^   r3   r   r   label2r   r   r   test_line_use_index_false   s   z)TestSeriesPlots.test_line_use_index_falsezWeird rounding problemsF)reasonstrictc                 C   sp  t g d}| j \}}tddgjjd|d}t|j	
 | t  | j \}}tddgjjd|d}t|j
 | t  t g d}| j \}}tg djdd|d	}d
}d}| }t|d | t|d | t|j	
 | t  | j \}}tg djdd|d	}| }t|d | t|d | t|j
 | d S )N)皙?      ?      $@g      Y@g     @@g     @   i  T)r#   r3   )gh㈵>g-C6?MbP?{Gz?r   r   r   )r   r   r   r/   )r#   r8   r3   g!,NJ?gЄ-??r   rP   r:   )rI   r   r\   rO   r   r,   r/   r   r   r%   get_ticklocsro   r:   r'   get_ylimassert_almost_equalrl   )r1   r   r^   r3   yminymaxresr   r   r   test_bar_log   s2   zTestSeriesPlots.test_bar_logc                 C   sJ   t g dg dd}| j \}}|jjd|d}| | g d d S )NrP   ra   rb   r   r   r   r   r   r   Fr   )0123)r   r\   rO   r,   r/   r]   get_xticklabels)r1   dfr^   r3   r   r   r   test_bar_ignore_index  s   z%TestSeriesPlots.test_bar_ignore_indexc                 C   sF   t g d}|jjg dd}dd |jD }g d}||ks!J d S )Nr   )redbluer   r   rE   c                 S      g | ]}|  qS r   )get_facecolor).0pr   r   r   
<listcomp>"      z8TestSeriesPlots.test_bar_user_colors.<locals>.<listcomp>)r           r   r   r   r   r   r   r   r   )r   r,   r/   rM   )r1   r   r3   resultr   r   r   r   test_bar_user_colors  s
   z$TestSeriesPlots.test_bar_user_colorsc                 C   sh   t tjdd}| j \}}|j|d}| j|dd | j \}}|jd|d}| j|dd d S )Nr?   rc   r   r   rv   )r   r3   )r   rI   rJ   rK   r\   rO   r,   r-   )r1   r   r^   r3   r2   r   r   r   test_rotation+  s   zTestSeriesPlots.test_rotationc                 C   s   ddl m} tdd}|g d }ttjt||}| j	 \}}|j
|d}|tdddd	|}|d
d || d ksDJ | j|dd d S )Nr   )DatetimeConverter1/1/2000z3/1/2000)	r   rP   ra   rb   r?   	   r)         rc   i  rP   r   z1/1/19991/1/2001rv   r   )%pandas.plotting._matplotlib.converterr   r   r   rI   rJ   rK   lenr\   rO   r,   convertr   set_xlimrl   r-   )r1   r   rngserr^   r3   xpr   r   r   test_irregular_datetime6  s   
z'TestSeriesPlots.test_irregular_datetimec              	   C   s   t ddtjddddgddddtjddgd}| j \}}|j|d	}| \}}| }|t|d
 j	ddd
 ks>J |t
|d
 j	ddd
 ksOJ d S )Nr   r   g      @g      @g      @g      @g       @r   rc   r   Frh   )r   rI   r   r\   rO   r,   rl   rm   nanminrn   nanmax)r1   r   r^   r3   rq   rr   rs   r   r   r   test_unsorted_index_xlimC  s   "&z(TestSeriesPlots.test_unsorted_index_xlimc           	      C   s  t tjddg ddd}t|jj}| |j|j	 |
 dks$J t|jjd d}| |jdgd  g d}t|jj|d	}g d
}| j|j|d g d}g d}t|jj||d}| |j| | j|j|d t|jj|ddd}dd |j|  D }ttt|j	|}| |j| |jD ]
}| dksJ qt g dg dd}tjtdd |j  W d    n1 sw   Y  t ddtjdgg ddd}t|jj}| |jg d d S )NrP   r?   )r   r   r   r   eYLABELr|   r   r   r   )rgr   rf   )r   r   r   r   r   rG   )ABCDE)r   r   r   r   m)r   rf   z%.2f   )rf   autopctfontsizec                 S   s   g | ]}|d  dqS )d   z.2fr   )r   r   r   r   r   r   o      z3TestSeriesPlots.test_pie_series.<locals>.<listcomp>)rP   ra   r   r   rT   r   z&pie plot doesn't allow negative valuesr   ra   r   r   )r   r   r   r   )r   rI   rJ   randintr   r,   pier]   textsr|   
get_ylabelrL   rM   r   sumlistr   from_iterablezipget_fontsizer   r   
ValueErrorr   )	r1   r   r3   
color_argscolor_expectedr   pctsexpected_textstr   r   r   test_pie_seriesO  s@   
zTestSeriesPlots.test_pie_seriesc                 C   sX   t dtjddg}| j \}}|jjd|d}g d}dd |jD }||ks*J d S )NrP   Tr   )r   r   r   r   c                 S   r   r   )get_text)r   xr   r   r   r     r   z0TestSeriesPlots.test_pie_nan.<locals>.<listcomp>)r   rI   r   r\   rO   r,   r   r   )r1   r   r^   r3   r   r   r   r   r   test_pie_nan  s   zTestSeriesPlots.test_pie_nanc                 C   sJ  t tjddtdd}ttjddd}| j \}}|j|d}|jdd|d	 | j	|g d
d |
  s=J |j
  sFJ t  | j \}}|j|d}|j|ddd | j	|g d
d |
  spJ |j
  syJ t  | j \}}|jd|d}|jdd|d	 g d}| j	|j|d |j
  rJ |
  sJ t  | j \}}|jd|d}|j|ddd g d}| 	|j| |j
  rJ |
  sJ t  | j \}}|jdd|d}|j|ddd g d
}| 	|j| |j
  rJ |
  sJ t  d S )Nrv   rb   abc)columnsr  r   rc   T)r   rk   r3   )r   r   r   	x (right)r   )r3   r   rk   rj   )z	a (right)z	b (right)z	c (right)r  F)rk   
mark_rightr3   )r   rI   rJ   rK   r  r   r\   rO   r,   r   	get_yaxisget_visibleright_axr   ro   left_ax)r1   r   r   r^   r3   r   r   r   r   test_df_series_secondary_legend  sP   z/TestSeriesPlots.test_df_series_secondary_legendzinput_logy, expected_scale)Tr#   )symsymlogc                 C   s^   t tjd}t tjd}|j|d}|jd|d}| |ks%J | |ks-J d S )Nrv   )r"   T)rk   r"   )r   rI   rJ   rK   r,   
get_yscale)r1   
input_logyexpected_scales1s2r   r   r   r   r   test_secondary_logy  s   z#TestSeriesPlots.test_secondary_logyc                 C   sf   t tjd}| j \}}d}tjt|d |j	dd|d W d    d S 1 s,w   Y  d S )Nra   zCannot pass 'style' string with a color symbol and 'color' keyword argument. Please use one or the other or pass 'style' without a color symbolr   zk--r   )r!   rF   r3   )
r   rI   rJ   rK   r\   rO   r   r   r  r,   )r1   r  r^   r3   r   r   r   r   )test_plot_fails_with_dupe_color_and_style  s   "z9TestSeriesPlots.test_plot_fails_with_dupe_color_and_stylec                 C   s   t ddd}t|jjddd t|jjd dd t|jjd t dd t|jjd|d t|jjd|d | j \}}|jjdd||d}| j	|d	d
 | 
|j d d S )Nir      scott)	bw_methodindg      ?T)r"   r$  r%  r3   r#   r$   Density)rI   linspacer   r,   r;   int_densityr\   rO   r.   r]   r%   	get_label)r1   r   sample_pointsr^   r3   r   r   r   test_kde_kwargs  s   zTestSeriesPlots.test_kde_kwargsc                 C   sJ   t tjjdd}tj|d< t|jj}tt	|j
d   s#J d S )N2   )sizer   )r   rI   rJ   uniformr   r   r,   r;   anyisnanrs   	get_xdata)r1   r   r2   r   r   r   test_kde_missing_vals  s   
"z%TestSeriesPlots.test_kde_missing_valszApi changed in 3.6.0)r   c                 C   sf   | j  \}}|jjd|d}| j|dd | }| ||jg | }| |dgt	|  d S )NT)r"   r3   r#   r$   r   )
r\   rO   r,   r>   r.   r   r]   r   get_yticklabelsr   )r1   r   r^   r3   xlabelsylabelsr   r   r   test_boxplot_series  s   z#TestSeriesPlots.test_boxplot_seriesc                 C   s\   t td}| j \}}|j||d | j  | j \}}t|j|  | j  d S )Nrb   r8   r3   )r   ranger\   rO   r,   ro   getattr)r1   r8   r   r^   r3   r   r   r   test_kind_both_ways   s   
z#TestSeriesPlots.test_kind_both_waysc                 C   s`   t td}| j \}}d}tjt|d |j||d W d    d S 1 s)w   Y  d S )Nabcdr   r   r8  )r   r  r\   rO   r   r   r   r,   r1   r8   r   r^   r3   r   r   r   r   test_invalid_plot_data     "z&TestSeriesPlots.test_invalid_plot_datac                 C   s"   t tdtd}t|j|d d S )Nr)   r   r@   )r   r9  objectr   r,   )r1   r8   r   r   r   r   test_valid_object_plot  s   z&TestSeriesPlots.test_valid_object_plotc                 C   s`   t g d}| j \}}d}tjt|d |j||d W d    d S 1 s)w   Y  d S )N)r   r   r   ra   r   r   r8  )r   r\   rO   r   r   r   r,   r=  r   r   r    test_partially_invalid_plot_data  r?  z0TestSeriesPlots.test_partially_invalid_plot_datac                 C   sL   t ddg}tjtdd |jdd W d    d S 1 sw   Y  d S )NrP   ra   z%invalid_kind is not a valid plot kindr   invalid_kindr@   )r   r   r   r  r,   )r1   r   r   r   r   test_invalid_kind$  s   "z!TestSeriesPlots.test_invalid_kindc                 C   sJ   t ddd}t ddd}||}tj|j}t||d}t|j d S )Nz1/1/2009r   periodsz1/2/2009r   )	r   appendrI   rJ   rK   r.  r   r   r,   )r1   dr1dr2r|   r   r   r   r   r   test_dup_datetime_index_plot)  s   
z,TestSeriesPlots.test_dup_datetime_index_plotc                 C   s   t tddd}tjdd}|j||d}tdd |jd  D }|j	t
d	dg | d	d }t|| d
t| d}tjt|d |jtjddd W d    n1 scw   Y  t  d S )Nr)   r  r   ra   )yerrxerrc                 S   s   g | ]}|j d d df qS )NrP   )verticesr   ir   r   r   r   8  s    z>TestSeriesPlots.test_errorbar_asymmetrical.<locals>.<listcomp>rP   rT   z?Asymmetrical error bars should be provided with the shape \(2, z\)r   r   rK  )r   rI   arangerJ   randr,   vstackcollections	get_pathsTr   to_numpyreshaper   r   r   r   r   r  ro   )r1   r   errr3   r   r   r   r   r   r   test_errorbar_asymmetrical1  s   $z*TestSeriesPlots.test_errorbar_asymmetricalc                 C   s@  t tddd}ttjd}tttjdd|jddgd}ddg}|D ]W}t|j	t ||d	}| j
|d
dd t|j	||d	}| j
|d
dd t|j	| |d	}| j
|d
dd t|j	||d	}| j
|d
dd t|j	dd|d}| j
|ddd q*t|j	|d}| j
|dd
d tdddd}t td|dd}t ttjd|d}	tttjdd|ddgd}
t|j	|	d}| j
|d
dd t|j	|
d}| j
|d
dd tt |j	tdd W d    n1 sw   Y  dgd }tt |j	|d W d    d S 1 sw   Y  d S )Nr)   r  r   ra   y)r|   r  r9   r/   )rK  r8   r   rP   )rL  rK  g?)rL  rK  r8   )rL  r   r   M)freqr   r   r   rP  r   zzz)r   rI   rQ  r   rJ   rK   r   r|   r   r,   _check_has_errorbarstolistr   r   external_error_raisedr  r   )r1   r   s_errd_errkindsr8   r3   ixr   ts_errtd_errr   r   r   test_errorbar_plotE  sD   "
$z"TestSeriesPlots.test_errorbar_plotc                 C   s    t |jdd t |j|d d S )NT)tabler6   rB   r   r   r   
test_tablep  s   zTestSeriesPlots.test_tablec                 C   s$   |  tg dtjjtjj  d S )Nr`   )_check_grid_settingsr   r	   PlotAccessor_series_kinds_common_kinds)r1   r   r   r   test_series_grid_settingsu  s   
z)TestSeriesPlots.test_series_grid_settingsr   )r   r   greenz#FF0000c                 C   s   ddl m} |d|d}||gksJ |d|gd}||gks!J |d|d}||gd ks0J |d|gd}||gd ks@J d S )Nr   get_standard_colorsrP   rE   rb   )!pandas.plotting._matplotlib.stylerr  )r1   r   rr  r   r   r   r   test_standard_colors~  s   z$TestSeriesPlots.test_standard_colorsc                 C   s  ddl m} ddlm} |jD ]<}|d|d}||gksJ |d|gd}||gks,J |d|d}||gd ks;J |d|gd}||gd ksKJ q|jjD ]<}|d|d}||gks_J |d|gd}||gksmJ |d|d}||gd ks|J |d|gd}||gd ksJ qPd S )Nr   r   rq  rP   )
num_colorsrF   rb   )
matplotlibrf   rs  rr  cnamesColorConverter)r1   rf   rr  r   r   r   r   r   test_standard_colors_all  s*   
z(TestSeriesPlots.test_standard_colors_allc                 C   sB   | j  \}}ttdd jd|d}| j| dgd d S )Nr   rP   rp  rF   r3   
linecolors)r\   rO   r   rI   rQ  r,   rL   rm   r1   r^   r3   r   r   r   test_series_plot_color_kwargs  s   z-TestSeriesPlots.test_series_plot_color_kwargsc                 C   sN   | j  \}}ttdd tddddjd|d}| j| dgd d S )	Nr   rP   r   rE  r   rp  rz  r{  )	r\   rO   r   rI   rQ  r   r,   rL   rm   r}  r   r   r   "test_time_series_plot_color_kwargs  s
   z2TestSeriesPlots.test_time_series_plot_color_kwargsc           	      C   s~   dd l }| |j}tddd}ttdd|d}d}| j \}}t	|D ]}|j
|d	}q'| j| |d | d
 d S )Nr   r   r   rE  rP      r   rb   rc   r{  )rv  _unpack_cyclerrd   r   r   rI   rQ  r\   rO   r9  r,   rL   rm   )	r1   mpl
def_colorsr|   r   ncolorsr^   r3   rO  r   r   r   -test_time_series_plot_color_with_empty_kwargs  s   z=TestSeriesPlots.test_time_series_plot_color_with_empty_kwargsc                 C   sb   t tddd tdD d}| j \}}|jg d|d}dd dD }| | | d S )Nr)   c                 S      g | ]}d |dqS P02dr   rN  r   r   r   r     r   z4TestSeriesPlots.test_xticklabels.<locals>.<listcomp>r   )r   rb   r?   r   )xticksr3   c                 S   r  r  r   rN  r   r   r   r     r   )	r   rI   rQ  r9  r\   rO   r,   r]   r   )r1   r   r^   r3   r   r   r   r   test_xticklabels  s
    z TestSeriesPlots.test_xticklabelsc                 C   s^   t tddd tdD d}|jjtdddd}tttddd}t||	  d S )	Nr)   c                 S   r  r  r   rN  r   r   r   r     r   z6TestSeriesPlots.test_xtick_barPlot.<locals>.<listcomp>r   r   r   ra   )r  )
r   r9  r,   r/   rI   r   r  r   r   
get_xticks)r1   r   r3   r   r   r   r   test_xtick_barPlot  s   z"TestSeriesPlots.test_xtick_barPlotc                 C   s@   ddl m} ttddtjdd|dgdd	d
}t|j d S )Nr   )CustomBusinessDayr   y   z
2014-05-01z
2014-06-01z
2014-05-26)holidays)startendr]  r   )pandas.tseries.offsetsr  r   r9  pdbdate_ranger   r,   )r1   r  r   r   r   r   test_custom_business_day_freq  s   
	z-TestSeriesPlots.test_custom_business_day_freqziGH#24426, see also github.com/pandas-dev/pandas/commit/ef1bd69fa42bbed5d09dd17f08c44fc8bfc2b685#r61470674c                 C   sj   t g d}| j \}}|j|d}|j }|jddgdd | j \}}|j }t|| d S )Nr   rc   r   rP   T)inplace)	r   r\   rO   r,   r'   r   dropr   r   )r1   r   r^   r3   beforeafterr   r   r   %test_plot_accessor_updates_on_inplace  s   

z5TestSeriesPlots.test_plot_accessor_updates_on_inplacer0   c                 C   sT   t ddg}| j \}}|j||d | }|d dk s J |d dks(J d S )Nra   rb   r8  r   rP   )r   r\   rO   r,   rl   )r1   r8   r   r^   r3   xlimsr   r   r   test_plot_xlim_for_series  s   z)TestSeriesPlots.test_plot_xlim_for_seriesc                 C   sh   t td}|js
J | }t| dksJ | d }t| dks(J t| dks2J d S )Nr   rP   r   )r   intemptyr,   r   rm   r2  r   )r1   r   r3   r9   r   r   r   test_plot_no_rows  s   

z!TestSeriesPlots.test_plot_no_rowsc                 C   sH   t g d}tjtdd |  W d    d S 1 sw   Y  d S )Nr   r   r   )r   r   r   r   r,   )r1   r   r   r   r   test_plot_no_numeric_data  s   
"z)TestSeriesPlots.test_plot_no_numeric_datazdata, indexr   )rb   ra   rP   r   )r)   r-  r"  rv   )iv  i  i  i  c                 C   sL   t ||d}|jdd}| }dd t|jdd dD }||ks$J d S )	N)r   r|   r/   r@   c                 S   s   g | ]}|  jqS r   )get_bboxr   )r   patchr   r   r   r   !  s    z3TestSeriesPlots.test_plot_order.<locals>.<listcomp>c                 S   s
   |   jS r5   )r  rr   )r  r   r   r   <lambda>#  s   
 z1TestSeriesPlots.test_plot_order.<locals>.<lambda>)re   )r   r,   r`  sortedrM   )r1   r   r|   r   r3   r   r   r   r   r   test_plot_order  s   	zTestSeriesPlots.test_plot_orderc                 C   s4   t ddg}|jddd}|jd  dksJ d S )NrP   ra   r   C3)r!   rF   r   )r   r,   rs   	get_color)r1   r   r3   r   r   r   test_style_single_ok'  s   z$TestSeriesPlots.test_style_single_okz index_name, old_label, new_label))Nr   new)oldr  r  )Nr   r   )r9   r0   r/   r:   r=   c                 C   s   t g d}||j_|j|d}|dkr%| dksJ | |ks$J n%|dkr:| dks1J | dks9J n| dksBJ | |ksJJ |j|||d}| |ksZJ | |ksbJ d S )Nr   r@   r:   r   r=   	Frequency)r8   ylabelxlabel)r   r|   r   r,   r   r   )r1   r8   
index_name	old_label	new_labelr   r3   r   r   r   test_xlabel_ylabel_series,  s   z)TestSeriesPlots.test_xlabel_ylabel_seriesr   ra   r   )r  rF  r]  rP   )daysc                 C   s0   d}t ddg|dj|d}| dksJ d S )N)rb   rP   rP   ra   r   )xlim)r   r,   rl   )r1   r|   r  r3   r   r   r   test_timedelta_indexG  s   	z$TestSeriesPlots.test_timedelta_index)M__name__
__module____qualname__r   markslowr4   r7   parametrizeparamtdskip_if_no_scipyrA   rC   rN   rV   r_   rg   rt   r~   r   r   r   r   makeDateIndexr   r   xfailr   r   r   r   r   r   r   r   r  r  r  r   r!  r,  r3  r7  r	   rl  rn  rm  r;  r>  rA  rB  rD  rJ  rZ  rh  rj  ro  rt  ry  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  timedelta_range	Timedeltar  r   r   r   r   r   )   s    


'
	

!0?



		


*

!



r   )!__doc__r   	itertoolsr   numpyrI   r   pandas.compatr   pandas.compat.numpyr   pandas.util._test_decoratorsutil_test_decoratorsr  pandasr  r   r   r   r	   pandas._testing_testingr   pandas.tests.plotting.commonr
   r   fixturer   r   r   skip_if_no_mplr   r   r   r   r   <module>   s(    


