File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1027,8 +1027,7 @@ def set_color(self, color):
1027
1027
----------
1028
1028
color : color
1029
1029
"""
1030
- if not cbook ._str_equal (color , 'auto' ):
1031
- mcolors ._check_color_like (color = color )
1030
+ mcolors ._check_color_like (color = color )
1032
1031
self ._color = color
1033
1032
self .stale = True
1034
1033
Original file line number Diff line number Diff line change 75
75
76
76
import numpy as np
77
77
78
- from matplotlib import _api , rcParams
78
+ from matplotlib import _api , cbook , rcParams
79
79
import matplotlib .artist as martist
80
+ import matplotlib .colors as mcolors
80
81
import matplotlib .text as mtext
81
-
82
82
from matplotlib .collections import LineCollection
83
83
from matplotlib .lines import Line2D
84
84
from matplotlib .patches import PathPatch
@@ -134,6 +134,14 @@ def get_ref_artist(self):
134
134
# docstring inherited
135
135
return self ._axis .majorTicks [0 ].tick1line
136
136
137
+ def set_color (self , color ):
138
+ # docstring inherited
139
+ # Unlike the base Line2D.set_color, this also supports "auto".
140
+ if not cbook ._str_equal (color , "auto" ):
141
+ mcolors ._check_color_like (color = color )
142
+ self ._color = color
143
+ self .stale = True
144
+
137
145
def get_color (self ):
138
146
return self .get_attribute_from_ref_artist ("color" )
139
147
You can’t perform that action at this time.
0 commit comments