File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1027,8 +1027,7 @@ def set_color(self, color):
10271027 ----------
10281028 color : color
10291029 """
1030- if not cbook ._str_equal (color , 'auto' ):
1031- mcolors ._check_color_like (color = color )
1030+ mcolors ._check_color_like (color = color )
10321031 self ._color = color
10331032 self .stale = True
10341033
Original file line number Diff line number Diff line change 7575
7676import numpy as np
7777
78- from matplotlib import _api , rcParams
78+ from matplotlib import _api , cbook , rcParams
7979import matplotlib .artist as martist
80+ import matplotlib .colors as mcolors
8081import matplotlib .text as mtext
81-
8282from matplotlib .collections import LineCollection
8383from matplotlib .lines import Line2D
8484from matplotlib .patches import PathPatch
@@ -134,6 +134,14 @@ def get_ref_artist(self):
134134 # docstring inherited
135135 return self ._axis .majorTicks [0 ].tick1line
136136
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+
137145 def get_color (self ):
138146 return self .get_attribute_from_ref_artist ("color" )
139147
You can’t perform that action at this time.
0 commit comments