@@ -807,6 +807,8 @@ def _maybe_right_yaxis(self, ax):
807807
808808 if (sec_true or has_sec ) and not hasattr (ax , 'right_ax' ):
809809 orig_ax , new_ax = ax , ax .twinx ()
810+ new_ax ._get_lines .color_cycle = orig_ax ._get_lines .color_cycle
811+
810812 orig_ax .right_ax , new_ax .left_ax = new_ax , orig_ax
811813
812814 if len (orig_ax .get_lines ()) == 0 : # no data on left y
@@ -1122,13 +1124,12 @@ def _get_colors(self):
11221124 cycle = plt .rcParams .get ('axes.color_cycle' , list ('bgrcmyk' ))
11231125 if isinstance (cycle , basestring ):
11241126 cycle = list (cycle )
1125- has_colors = 'color' in self .kwds
11261127 colors = self .kwds .get ('color' , cycle )
11271128 return colors
11281129
11291130 def _maybe_add_color (self , colors , kwds , style , i ):
1130- kwds . pop ( 'color' , None )
1131- if style is None or re .match ('[a-z]+' , style ) is None :
1131+ has_color = 'color' in kwds
1132+ if has_color and ( style is None or re .match ('[a-z]+' , style ) is None ) :
11321133 kwds ['color' ] = colors [i % len (colors )]
11331134
11341135 def _make_plot (self ):
@@ -2147,6 +2148,8 @@ def on_right(i):
21472148 if on_right (0 ):
21482149 orig_ax = ax0
21492150 ax0 = ax0 .twinx ()
2151+ ax0 ._get_lines .color_cycle = orig_ax ._get_lines .color_cycle
2152+
21502153 orig_ax .get_yaxis ().set_visible (False )
21512154 orig_ax .right_ax = ax0
21522155 ax0 .left_ax = orig_ax
@@ -2164,6 +2167,8 @@ def on_right(i):
21642167 if on_right (i ):
21652168 orig_ax = ax
21662169 ax = ax .twinx ()
2170+ ax ._get_lines .color_cycle = orig_ax ._get_lines .color_cycle
2171+
21672172 orig_ax .get_yaxis ().set_visible (False )
21682173 axarr [i ] = ax
21692174
0 commit comments