@@ -876,8 +876,7 @@ def _get_colors(self):
876
876
colors = self .kwds .pop ('colors' , cycle )
877
877
return has_colors , colors
878
878
879
- def _maybe_add_color (self , kwds , style , i ):
880
- has_colors , colors = self ._get_colors ()
879
+ def _maybe_add_color (self , has_colors , colors , kwds , style , i ):
881
880
if (not has_colors and
882
881
(style is None or re .match ('[a-z]+' , style ) is None )
883
882
and 'color' not in kwds ):
@@ -894,12 +893,13 @@ def _make_plot(self):
894
893
x = self ._get_xticks (convert_period = True )
895
894
896
895
plotf = self ._get_plot_function ()
896
+ has_colors , colors = self ._get_colors ()
897
897
898
898
for i , (label , y ) in enumerate (self ._iter_data ()):
899
899
ax = self ._get_ax (i )
900
900
style = self ._get_style (i , label )
901
901
kwds = self .kwds .copy ()
902
- self ._maybe_add_color (kwds , style , i )
902
+ self ._maybe_add_color (has_colors , colors , kwds , style , i )
903
903
904
904
label = _stringify (label )
905
905
@@ -943,7 +943,7 @@ def to_leg_label(label, i):
943
943
style = self .style or ''
944
944
label = com ._stringify (self .label )
945
945
kwds = kwargs .copy ()
946
- self ._maybe_add_color (kwds , style , 0 )
946
+ self ._maybe_add_color (has_colors , colors , kwds , style , 0 )
947
947
948
948
newlines = tsplot (data , plotf , ax = ax , label = label , style = self .style ,
949
949
** kwds )
@@ -958,7 +958,7 @@ def to_leg_label(label, i):
958
958
style = self ._get_style (i , col )
959
959
kwds = kwargs .copy ()
960
960
961
- self ._maybe_add_color (kwds , style , i )
961
+ self ._maybe_add_color (has_colors , colors , kwds , style , i )
962
962
963
963
newlines = tsplot (data [col ], plotf , ax = ax , label = label ,
964
964
style = style , ** kwds )
0 commit comments