@@ -365,25 +365,6 @@ def test_pie_nan(self):
365
365
result = [x .get_text () for x in ax .texts ]
366
366
assert result == expected
367
367
368
- def test_hist_df_kwargs (self ):
369
- df = DataFrame (np .random .randn (10 , 2 ))
370
- _ , ax = self .plt .subplots ()
371
- ax = df .plot .hist (bins = 5 , ax = ax )
372
- assert len (ax .patches ) == 10
373
-
374
- def test_hist_df_with_nonnumerics (self ):
375
- # GH 9853
376
- with tm .RNGContext (1 ):
377
- df = DataFrame (np .random .randn (10 , 4 ), columns = ["A" , "B" , "C" , "D" ])
378
- df ["E" ] = ["x" , "y" ] * 5
379
- _ , ax = self .plt .subplots ()
380
- ax = df .plot .hist (bins = 5 , ax = ax )
381
- assert len (ax .patches ) == 20
382
-
383
- _ , ax = self .plt .subplots ()
384
- ax = df .plot .hist (ax = ax ) # bins=10
385
- assert len (ax .patches ) == 40
386
-
387
368
def test_hist_legacy (self ):
388
369
_check_plot_works (self .ts .hist )
389
370
_check_plot_works (self .ts .hist , grid = False )
@@ -468,44 +449,6 @@ def test_hist_no_overlap(self):
468
449
axes = fig .axes
469
450
assert len (axes ) == 2
470
451
471
- def test_hist_secondary_legend (self ):
472
- # GH 9610
473
- df = DataFrame (np .random .randn (30 , 4 ), columns = list ("abcd" ))
474
-
475
- # primary -> secondary
476
- _ , ax = self .plt .subplots ()
477
- ax = df ["a" ].plot .hist (legend = True , ax = ax )
478
- df ["b" ].plot .hist (ax = ax , legend = True , secondary_y = True )
479
- # both legends are dran on left ax
480
- # left and right axis must be visible
481
- self ._check_legend_labels (ax , labels = ["a" , "b (right)" ])
482
- assert ax .get_yaxis ().get_visible ()
483
- assert ax .right_ax .get_yaxis ().get_visible ()
484
- tm .close ()
485
-
486
- # secondary -> secondary
487
- _ , ax = self .plt .subplots ()
488
- ax = df ["a" ].plot .hist (legend = True , secondary_y = True , ax = ax )
489
- df ["b" ].plot .hist (ax = ax , legend = True , secondary_y = True )
490
- # both legends are draw on left ax
491
- # left axis must be invisible, right axis must be visible
492
- self ._check_legend_labels (ax .left_ax , labels = ["a (right)" , "b (right)" ])
493
- assert not ax .left_ax .get_yaxis ().get_visible ()
494
- assert ax .get_yaxis ().get_visible ()
495
- tm .close ()
496
-
497
- # secondary -> primary
498
- _ , ax = self .plt .subplots ()
499
- ax = df ["a" ].plot .hist (legend = True , secondary_y = True , ax = ax )
500
- # right axes is returned
501
- df ["b" ].plot .hist (ax = ax , legend = True )
502
- # both legends are draw on left ax
503
- # left and right axis must be visible
504
- self ._check_legend_labels (ax .left_ax , labels = ["a (right)" , "b" ])
505
- assert ax .left_ax .get_yaxis ().get_visible ()
506
- assert ax .get_yaxis ().get_visible ()
507
- tm .close ()
508
-
509
452
def test_df_series_secondary_legend (self ):
510
453
# GH 9779
511
454
df = DataFrame (np .random .randn (30 , 3 ), columns = list ("abc" ))
@@ -590,28 +533,6 @@ def test_plot_fails_with_dupe_color_and_style(self):
590
533
_ , ax = self .plt .subplots ()
591
534
x .plot (style = "k--" , color = "k" , ax = ax )
592
535
593
- @td .skip_if_no_scipy
594
- def test_hist_kde (self ):
595
-
596
- _ , ax = self .plt .subplots ()
597
- ax = self .ts .plot .hist (logy = True , ax = ax )
598
- self ._check_ax_scales (ax , yaxis = "log" )
599
- xlabels = ax .get_xticklabels ()
600
- # ticks are values, thus ticklabels are blank
601
- self ._check_text_labels (xlabels , ["" ] * len (xlabels ))
602
- ylabels = ax .get_yticklabels ()
603
- self ._check_text_labels (ylabels , ["" ] * len (ylabels ))
604
-
605
- _check_plot_works (self .ts .plot .kde )
606
- _check_plot_works (self .ts .plot .density )
607
- _ , ax = self .plt .subplots ()
608
- ax = self .ts .plot .kde (logy = True , ax = ax )
609
- self ._check_ax_scales (ax , yaxis = "log" )
610
- xlabels = ax .get_xticklabels ()
611
- self ._check_text_labels (xlabels , ["" ] * len (xlabels ))
612
- ylabels = ax .get_yticklabels ()
613
- self ._check_text_labels (ylabels , ["" ] * len (ylabels ))
614
-
615
536
@td .skip_if_no_scipy
616
537
def test_kde_kwargs (self ):
617
538
sample_points = np .linspace (- 100 , 100 , 20 )
@@ -634,37 +555,6 @@ def test_kde_missing_vals(self):
634
555
# gh-14821: check if the values have any missing values
635
556
assert any (~ np .isnan (axes .lines [0 ].get_xdata ()))
636
557
637
- def test_hist_kwargs (self ):
638
- _ , ax = self .plt .subplots ()
639
- ax = self .ts .plot .hist (bins = 5 , ax = ax )
640
- assert len (ax .patches ) == 5
641
- self ._check_text_labels (ax .yaxis .get_label (), "Frequency" )
642
- tm .close ()
643
-
644
- _ , ax = self .plt .subplots ()
645
- ax = self .ts .plot .hist (orientation = "horizontal" , ax = ax )
646
- self ._check_text_labels (ax .xaxis .get_label (), "Frequency" )
647
- tm .close ()
648
-
649
- _ , ax = self .plt .subplots ()
650
- ax = self .ts .plot .hist (align = "left" , stacked = True , ax = ax )
651
- tm .close ()
652
-
653
- @td .skip_if_no_scipy
654
- def test_hist_kde_color (self ):
655
- _ , ax = self .plt .subplots ()
656
- ax = self .ts .plot .hist (logy = True , bins = 10 , color = "b" , ax = ax )
657
- self ._check_ax_scales (ax , yaxis = "log" )
658
- assert len (ax .patches ) == 10
659
- self ._check_colors (ax .patches , facecolors = ["b" ] * 10 )
660
-
661
- _ , ax = self .plt .subplots ()
662
- ax = self .ts .plot .kde (logy = True , color = "r" , ax = ax )
663
- self ._check_ax_scales (ax , yaxis = "log" )
664
- lines = ax .get_lines ()
665
- assert len (lines ) == 1
666
- self ._check_colors (lines , ["r" ])
667
-
668
558
def test_boxplot_series (self ):
669
559
_ , ax = self .plt .subplots ()
670
560
ax = self .ts .plot .box (logy = True , ax = ax )
0 commit comments