@@ -807,6 +807,8 @@ def _maybe_right_yaxis(self, ax):
807
807
808
808
if (sec_true or has_sec ) and not hasattr (ax , 'right_ax' ):
809
809
orig_ax , new_ax = ax , ax .twinx ()
810
+ new_ax ._get_lines .color_cycle = orig_ax ._get_lines .color_cycle
811
+
810
812
orig_ax .right_ax , new_ax .left_ax = new_ax , orig_ax
811
813
812
814
if len (orig_ax .get_lines ()) == 0 : # no data on left y
@@ -1122,13 +1124,12 @@ def _get_colors(self):
1122
1124
cycle = plt .rcParams .get ('axes.color_cycle' , list ('bgrcmyk' ))
1123
1125
if isinstance (cycle , basestring ):
1124
1126
cycle = list (cycle )
1125
- has_colors = 'color' in self .kwds
1126
1127
colors = self .kwds .get ('color' , cycle )
1127
1128
return colors
1128
1129
1129
1130
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 ) :
1132
1133
kwds ['color' ] = colors [i % len (colors )]
1133
1134
1134
1135
def _make_plot (self ):
@@ -2147,6 +2148,8 @@ def on_right(i):
2147
2148
if on_right (0 ):
2148
2149
orig_ax = ax0
2149
2150
ax0 = ax0 .twinx ()
2151
+ ax0 ._get_lines .color_cycle = orig_ax ._get_lines .color_cycle
2152
+
2150
2153
orig_ax .get_yaxis ().set_visible (False )
2151
2154
orig_ax .right_ax = ax0
2152
2155
ax0 .left_ax = orig_ax
@@ -2164,6 +2167,8 @@ def on_right(i):
2164
2167
if on_right (i ):
2165
2168
orig_ax = ax
2166
2169
ax = ax .twinx ()
2170
+ ax ._get_lines .color_cycle = orig_ax ._get_lines .color_cycle
2171
+
2167
2172
orig_ax .get_yaxis ().set_visible (False )
2168
2173
axarr [i ] = ax
2169
2174
0 commit comments