@@ -466,6 +466,8 @@ def test_style_by_column(self):
466
466
@slow
467
467
def test_line_colors (self ):
468
468
import matplotlib .pyplot as plt
469
+ import sys
470
+ from StringIO import StringIO
469
471
470
472
custom_colors = 'rgcby'
471
473
@@ -480,6 +482,16 @@ def test_line_colors(self):
480
482
rs = l .get_color ()
481
483
self .assert_ (xp == rs )
482
484
485
+ tmp = sys .stderr
486
+ sys .stderr = StringIO ()
487
+ try :
488
+ plt .close ('all' )
489
+ ax2 = df .plot (colors = custom_colors )
490
+ lines2 = ax2 .get_lines ()
491
+ for l1 , l2 in zip (lines , lines2 ):
492
+ self .assert_ (l1 .get_color (), l2 .get_color ())
493
+ finally :
494
+ sys .stderr = tmp
483
495
484
496
class TestDataFrameGroupByPlots (unittest .TestCase ):
485
497
@@ -513,6 +525,8 @@ def test_boxplot(self):
513
525
_check_plot_works (grouped .boxplot )
514
526
_check_plot_works (grouped .boxplot , subplots = False )
515
527
528
+
529
+
516
530
@slow
517
531
def test_series_plot_color_kwargs (self ):
518
532
# #1890
@@ -533,6 +547,13 @@ def test_time_series_plot_color_kwargs(self):
533
547
line = ax .get_lines ()[0 ]
534
548
self .assert_ (line .get_color () == 'green' )
535
549
550
+ @slow
551
+ def test_grouped_hist (self ):
552
+ df = DataFrame (np .random .randn (50 , 2 ), columns = ['A' , 'B' ])
553
+ df ['C' ] = np .random .randint (0 , 3 , 50 )
554
+ axes = plotting .grouped_hist (df .A , by = df .C )
555
+ self .assert_ (len (axes .ravel ()) == 4 )
556
+
536
557
PNG_PATH = 'tmp.png'
537
558
538
559
def _check_plot_works (f , * args , ** kwargs ):
0 commit comments