File tree 3 files changed +14
-19
lines changed
3 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -1111,8 +1111,6 @@ def get_hatch_color(self):
1111
1111
"""
1112
1112
Gets the color to use for hatching.
1113
1113
"""
1114
- if self ._hatch_color is None :
1115
- return colors .to_rgba (rcParams ['hatch.color' ])
1116
1114
return self ._hatch_color
1117
1115
1118
1116
def set_hatch_color (self , hatch_color ):
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ def __init__(self,
136
136
self ._linewidths = [0 ]
137
137
self ._is_filled = True # May be modified by set_facecolor().
138
138
139
- self ._hatch_color = None
139
+ self ._hatch_color = mcolors . to_rgba ( mpl . rcParams [ 'hatch.color' ])
140
140
self .set_facecolor (facecolors )
141
141
self .set_edgecolor (edgecolors )
142
142
self .set_linewidth (linewidths )
@@ -294,14 +294,12 @@ def draw(self, renderer):
294
294
295
295
if self ._hatch :
296
296
gc .set_hatch (self ._hatch )
297
- if self ._hatch_color is not None :
298
- try :
299
- gc .set_hatch_color (self ._hatch_color )
300
- except AttributeError :
301
- # if we end up with a GC that does not have this method
302
- warnings .warn ("Your backend does not support setting the "
303
- "hatch color." )
304
-
297
+ try :
298
+ gc .set_hatch_color (self ._hatch_color )
299
+ except AttributeError :
300
+ # if we end up with a GC that does not have this method
301
+ warnings .warn ("Your backend does not support setting the "
302
+ "hatch color." )
305
303
306
304
if self .get_sketch_params () is not None :
307
305
gc .set_sketch_params (* self .get_sketch_params ())
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def __init__(self,
114
114
if antialiased is None :
115
115
antialiased = mpl .rcParams ['patch.antialiased' ]
116
116
117
- self ._hatch_color = None
117
+ self ._hatch_color = colors . to_rgba ( mpl . rcParams [ 'hatch.color' ])
118
118
self ._fill = True # needed for set_facecolor call
119
119
if color is not None :
120
120
if (edgecolor is not None or facecolor is not None ):
@@ -551,13 +551,12 @@ def draw(self, renderer):
551
551
552
552
if self ._hatch :
553
553
gc .set_hatch (self ._hatch )
554
- if self ._hatch_color is not None :
555
- try :
556
- gc .set_hatch_color (self ._hatch_color )
557
- except AttributeError :
558
- # if we end up with a GC that does not have this method
559
- warnings .warn ("Your backend does not have support for "
560
- "setting the hatch color." )
554
+ try :
555
+ gc .set_hatch_color (self ._hatch_color )
556
+ except AttributeError :
557
+ # if we end up with a GC that does not have this method
558
+ warnings .warn ("Your backend does not have support for "
559
+ "setting the hatch color." )
561
560
562
561
if self .get_sketch_params () is not None :
563
562
gc .set_sketch_params (* self .get_sketch_params ())
You can’t perform that action at this time.
0 commit comments