3
Êb_ò  ã               @   sX   d Z ddlZddljjZddlmZm	Z	 ddl
jZddlmZ ejG dd„ deƒƒZdS )z Test cases for GroupBy.plot é    N)Ú	DataFrameÚSeries)ÚTestPlotBasec               @   s4   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ ZdS )ÚTestDataFrameGroupByPlotsc             C   s¤   d}t tjjdd|d�ƒ}t tjjdd|d�ƒ}tjdƒ� tjjddg|d�}W d Q R X |j|ƒjƒ  tj	ƒ  |j|ƒj
ƒ  tj	ƒ  |j|ƒjd	d
� tj	ƒ  d S )Né
   é¦   é   )Úsizeé<   é*   ZmaleZfemaleg      à?)Úalpha)r   ÚnpÚrandomZnormalÚtmZ
RNGContextÚchoiceÚgroupbyÚplotÚcloseÚhist)ÚselfÚnZweightÚheightZgender© r   úD/tmp/pip-build-jkwsxyiy/pandas/pandas/tests/plotting/test_groupby.pyÚ,test_series_groupby_plotting_nominally_works   s    zFTestDataFrameGroupByPlots.test_series_groupby_plotting_nominally_worksc             C   s|   t dddddddddg	tjjdƒdœdddddddddg	d	�}|jd
ƒd jƒ  tjƒ  |jd
ƒd jdd„ ƒ tjƒ  d S )Né   é   é   é	   )ÚdefÚvalg      ð?g       @g      @)Úindexr   r    c             S   s   | j ƒ S )N)r   )Úxr   r   r   Ú<lambda>)   s    zPTestDataFrameGroupByPlots.test_plotting_with_float_index_works.<locals>.<lambda>)	r   r   r   Zrandnr   r   r   r   Úapply)r   Údfr   r   r   Ú$test_plotting_with_float_index_works    s    "z>TestDataFrameGroupByPlots.test_plotting_with_float_index_worksc             C   sp   t jdddƒ}tddgddgddgd	œƒ}|d
 j|d |d� tdgdgdgd	œƒ}|d
 j|d |d� d S )NéP   éd   r   r   ZAAAZBBBéU   éY   )ÚNameÚByColÚMarkr-   r,   )ZbyÚbinséf   )r   Zaranger   r   )r   r.   r%   r   r   r   Útest_hist_single_row,   s
    z.TestDataFrameGroupByPlots.test_hist_single_rowc             C   sd   t dddddgdddddgtdƒdœƒ}|jdƒjjd	d
ƒ tjƒ  |jdƒd	 jjƒ  tjƒ  d S )Nr   r   r   é   é   Úababa)r"   ÚyÚzr5   r"   r4   )r   Úlistr   r   Úscatterr   r   Úline)r   r%   r   r   r   Útest_plot_submethod_works4   s
    (z3TestDataFrameGroupByPlots.test_plot_submethod_worksc             C   s„   t dddddgdddddgtdƒdœƒ}|jdƒjd	d
dd�}t|d jƒdksTt‚|jdƒjjd
dd�}t|d jƒdks€t‚d S )Nr   r   r   r1   r2   r3   )r"   r4   r5   r5   r7   r"   r4   )Úkindr"   r4   Úa)r"   r4   )r   r6   r   r   ÚlenÚcollectionsÚAssertionErrorr7   )r   r%   Úresr   r   r   Útest_plot_kwargs;   s
    (z*TestDataFrameGroupByPlots.test_plot_kwargsN)Ú__name__Ú
__module__Ú__qualname__r   r&   r0   r9   r@   r   r   r   r   r      s
   r   )Ú__doc__Znumpyr   Zpandas.util._test_decoratorsÚutilZ_test_decoratorsÚtdZpandasr   r   Zpandas._testingZ_testingr   Zpandas.tests.plotting.commonr   Zskip_if_no_mplr   r   r   r   r   Ú<module>   s   
