File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -537,6 +537,21 @@ def test_line_colors(self):
537
537
plt .close ('all' )
538
538
df .ix [:, [0 ]].plot (color = 'DodgerBlue' )
539
539
540
+ @slow
541
+ def test_default_color_cycle (self ):
542
+ import matplotlib .pyplot as plt
543
+ plt .rcParams ['axes.color_cycle' ] = list ('rgbk' )
544
+
545
+ plt .close ('all' )
546
+ df = DataFrame (np .random .randn (5 , 3 ))
547
+ ax = df .plot ()
548
+
549
+ lines = ax .get_lines ()
550
+ for i , l in enumerate (lines ):
551
+ xp = plt .rcParams ['axes.color_cycle' ][i ]
552
+ rs = l .get_color ()
553
+ self .assert_ (xp == rs )
554
+
540
555
541
556
class TestDataFrameGroupByPlots (unittest .TestCase ):
542
557
Original file line number Diff line number Diff line change @@ -979,7 +979,9 @@ def _use_dynamic_x(self):
979
979
980
980
def _get_colors (self ):
981
981
import matplotlib .pyplot as plt
982
- cycle = '' .join (plt .rcParams .get ('axes.color_cycle' , list ('bgrcmyk' )))
982
+ cycle = plt .rcParams .get ('axes.color_cycle' , list ('bgrcmyk' ))
983
+ if isinstance (cycle , basestring ):
984
+ cycle = list (cycle )
983
985
has_colors = 'color' in self .kwds
984
986
colors = self .kwds .get ('color' , cycle )
985
987
return colors
You can’t perform that action at this time.
0 commit comments