
    4iq                     t    S r SSKrSSKrSSKJrJrJr  SSKJ	r	J
r
  \R                  " S5         " S S5      rg)zTest cases for GroupBy.plot    N)	DataFrameIndexSeries)_check_axes_shape_check_legend_labels
matplotlibc                       \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS r\R                   R#                  SSS/5      S 5       r\R                   R#                  SSS/5      S 5       rS rS rSrg)TestDataFrameGroupByPlots   c                    Sn[        [        R                  R                  S5      R	                  SSUS95      n[        R                  R                  S5      R                  SS/US9nUR                  U5      R                  5         g )N
            sizemalefemaler   nprandomdefault_rngnormalchoicegroupbyplot)selfnweightgenders       d/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/pandas/tests/plotting/test_groupby.py,test_series_groupby_plotting_nominally_worksFTestDataFrameGroupByPlots.test_series_groupby_plotting_nominally_works   sp    		--a077Ra7HI&&q)00&(1C!0Lv##%    c                    Sn[        [        R                  R                  S5      R	                  SSUS95      n[        R                  R                  S5      R                  SS/US9nUR                  U5      R                  5         g )Nr   r   <   r   r   r   )r   r   r   r   r   r   r   histr   r   heightr    s       r!   1test_series_groupby_plotting_nominally_works_histKTestDataFrameGroupByPlots.test_series_groupby_plotting_nominally_works_hist   sp    		--a077BQ7GH&&q)00&(1C!0Lv##%r$   c                    Sn[        [        R                  R                  S5      R	                  SSUS95      n[        R                  R                  S5      R                  SS/US9nUR                  U5      R                  SS9  g )	Nr   r   r&   r   r   r   g      ?)alphar   r(   s       r!   2test_series_groupby_plotting_nominally_works_alphaLTestDataFrameGroupByPlots.test_series_groupby_plotting_nominally_works_alpha!   su    		--a077BQ7GH&&q)00&(1C!0Lv####.r$   c                     [        / SQ[        R                  R                  S5      R	                  S5      S./ SQS9nUR                  S5      S   R                  5         g )	N	   r2   r2   r   r   r      r3   r3   r   	   defval	      ?       @      @r9   r:   r;   r9   r:   r;   indexr6   r7   )r   r   r   r   standard_normalr   r   r   dfs     r!   $test_plotting_with_float_index_works>TestDataFrameGroupByPlots.test_plotting_with_float_index_works(   sS    2yy,,Q/??B @
 	

5% %%'r$   c                     [        / SQ[        R                  R                  S5      R	                  S5      S./ SQS9nUR                  S5      S   R                  S	 5        g )
Nr1   r   r4   r5   r8   r<   r6   r7   c                 "    U R                  5       $ )N)r   )xs    r!   <lambda>VTestDataFrameGroupByPlots.test_plotting_with_float_index_works_apply.<locals>.<lambda>=   s
    r$   )r   r   r   r   r>   r   applyr?   s     r!   *test_plotting_with_float_index_works_applyDTestDataFrameGroupByPlots.test_plotting_with_float_index_works_apply4   sV    2yy,,Q/??B @
 	

5% &&'9:r$   c                     [         R                  " SSS5      n[        SS/SS/SS/S	.5      nUS
   R                  US   US9  g )NP   f   r2   AAABBBr   U   Y   NameByColMarkrU   rT   bybinsr   aranger   r'   r   rX   r@   s      r!   test_hist_single_row.TestDataFrameGroupByPlots.test_hist_single_row?   sI    yyWa(!Q"bRS
6
2g;T2r$   c                     [         R                  " SSS5      n[        S/S/S/S.5      nUS   R                  US   US	9  g )
NrL   rM   r2   rN   rP   rR   rU   rT   rV   rY   r[   s      r!   !test_hist_single_row_single_bycol;TestDataFrameGroupByPlots.test_hist_single_row_single_bycolE   sC    yyWa(1#tDE
6
2g;T2r$   c                     [        / SQ/ SQ[        S5      S.5      nUR                  S5      R                  R	                  SS5        g )Nr2   r   r3         r2   r   r3   r   r2   ababarE   yzri   rE   rh   )r   listr   r   scatterr?   s     r!   test_plot_submethod_works3TestDataFrameGroupByPlots.test_plot_submethod_worksK   s5    _?gWX


3$$S#.r$   c                     [        / SQ/ SQ[        S5      S.5      nUR                  S5      S   R                  R	                  5         g )Nrb   re   rf   rg   ri   rE   )r   rj   r   r   liner?   s     r!   test_plot_submethod_works_line8TestDataFrameGroupByPlots.test_plot_submethod_works_lineO   s6    _?gWX


3!!&&(r$   c                     [        / SQ/ SQ[        S5      S.5      nUR                  S5      R                  SSSS	9n[	        US
   R
                  5      S:X  d   eg )Nrb   re   rf   rg   ri   rk   rE   rh   )kindrE   rh   ar2   )r   rj   r   r   lencollectionsr   r@   ress      r!   test_plot_kwargs*TestDataFrameGroupByPlots.test_plot_kwargsS   sU    _?gWXjjo""	SC"@ 3s8''(A---r$   c                     [        / SQ/ SQ[        S5      S.5      nUR                  S5      R                  R	                  SSS9n[        US	   R                  5      S
:X  d   eg )Nrb   re   rf   rg   ri   rE   rh   )rE   rh   rt   r2   )r   rj   r   r   rk   ru   rv   rw   s      r!   test_plot_kwargs_scatter2TestDataFrameGroupByPlots.test_plot_kwargs_scatter[   sW    _?gWXjjo""**SC*83s8''(A---r$   zcolumn, expected_axes_num)Nr   )br2   c                 n   SU4nU=(       d    S/S//n[        SS/-  SS/-  -   SS9n[        [        R                  R	                  S	5      R                  S
5      USS/S9nUR                  S5      nUR                  SUS9 H/  n[        XUS9  [        US   USS9 H  u  p[        X5        M     M1     g )Nr2   rt   r~      12cnamer      r   r=   columnsT)legendcolumnaxes_numlayoutr   )strict)r   r   r   r   r   r>   r   r'   r   zipr   )r   r   expected_axes_numexpected_layoutexpected_labelsr=   r@   gaxesaxexpected_labels              r!   #test_groupby_hist_frame_with_legend=TestDataFrameGroupByPlots.test_groupby_hist_frame_with_legend`   s     /0 2cUSENbC5j2:-C8II!!!$44W=#J

 JJsOFF$vF6DdW&)$q'?4&P"$R8 'Q 7r$   r   Nr~   c                 J   [        SS/-  SS/-  -   SS9n[        [        R                  R	                  S5      R                  S5      USS	/S
9nUR                  S5      n[        R                  " [        SS9   UR                  SUSS9  S S S 5        g ! , (       d  f       g = f)Nr   r   r   r   r   r   r   rt   r~   r    Cannot use both legend and labelmatchTd)r   r   labelr   r   r   r   r   r>   r   pytestraises
ValueErrorr'   )r   r   r=   r@   r   s        r!   *test_groupby_hist_frame_with_legend_raisesDTestDataFrameGroupByPlots.test_groupby_hist_frame_with_legend_raisess   s     bC5j2:-C8II!!!$44W=#J

 JJsO]]:-OPFF$vSF9 QPPs   9B
B"c                 &   [        SS/-  SS/-  -   SS9n[        [        R                  R	                  S5      R                  S5      USS	/S
9nUR                  S5      nUS   R                  SS9 H  n[        USSS9  [        USS/5        M     g )Nr   r   r   r   r   r   r   rt   r~   r   T)r   r2   )r2   r2   r   )
r   r   r   r   r   r>   r   r'   r   r   )r   r=   r@   r   r   s        r!   $test_groupby_hist_series_with_legend>TestDataFrameGroupByPlots.test_groupby_hist_series_with_legend   s    bC5j2:-C8II!!!$44W=#J

 JJsOC&++T+*Bb1V< c3Z0 +r$   c                 H   [        SS/-  SS/-  -   SS9n[        [        R                  R	                  S5      R                  S5      USS	/S
9nUR                  S5      n[        R                  " [        SS9   UR                  SSS9  S S S 5        g ! , (       d  f       g = f)Nr   r   r   r   r   r   r   rt   r~   r   r   r   Tr   )r   r   r   )r   r=   r@   r   s       r!   +test_groupby_hist_series_with_legend_raisesETestDataFrameGroupByPlots.test_groupby_hist_series_with_legend_raises   s    bC5j2:-C8II!!!$44W=#J

 JJsO]]:-OPFF$cF* QPPs   9B
B! )__name__
__module____qualname____firstlineno__r"   r*   r.   rA   rI   r\   r_   rl   rp   ry   r|   r   markparametrizer   r   r   r   __static_attributes__r   r$   r!   r
   r
      s    &&/
(	;33/)..
 [[89h:OP9 Q9$ [[Xc{3: 4:1+r$   r
   )__doc__numpyr   r   pandasr   r   r   pandas.tests.plotting.commonr   r   importorskipr
   r   r$   r!   <module>r      s9    !   

   L !G+ G+r$   