File tree 3 files changed +19
-6
lines changed 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change
1
+ Deprecations
2
+ ------------
3
+
4
+ Support for custom backends that do not provide a ``set_hatch_color `` method is
5
+ deprecated. We suggest that custom backends let their ``GraphicsContext ``
6
+ class inherit from `GraphicsContextBase `, to at least provide stubs for all
7
+ required methods.
Original file line number Diff line number Diff line change @@ -271,8 +271,10 @@ def draw(self, renderer):
271
271
gc .set_hatch_color (self ._hatch_color )
272
272
except AttributeError :
273
273
# if we end up with a GC that does not have this method
274
- warnings .warn ("Your backend does not support setting the "
275
- "hatch color." )
274
+ cbook .warn_deprecated (
275
+ "3.1" , "Your backend does not support setting the hatch "
276
+ "color; such backends will become unsupported in "
277
+ "Matplotlib 3.3." )
276
278
277
279
if self .get_sketch_params () is not None :
278
280
gc .set_sketch_params (* self .get_sketch_params ())
Original file line number Diff line number Diff line change @@ -517,8 +517,10 @@ def draw(self, renderer):
517
517
gc .set_hatch_color (self ._hatch_color )
518
518
except AttributeError :
519
519
# if we end up with a GC that does not have this method
520
- warnings .warn (
521
- "Your backend does not support setting the hatch color." )
520
+ cbook .warn_deprecated (
521
+ "3.1" , "Your backend does not support setting the hatch "
522
+ "color; such backends will become unsupported in "
523
+ "Matplotlib 3.3." )
522
524
523
525
if self .get_sketch_params () is not None :
524
526
gc .set_sketch_params (* self .get_sketch_params ())
@@ -4290,8 +4292,10 @@ def draw(self, renderer):
4290
4292
gc .set_hatch_color (self ._hatch_color )
4291
4293
except AttributeError :
4292
4294
# if we end up with a GC that does not have this method
4293
- warnings .warn ("Your backend does not support setting the "
4294
- "hatch color." )
4295
+ cbook .warn_deprecated (
4296
+ "3.1" , "Your backend does not support setting the "
4297
+ "hatch color; such backends will become unsupported "
4298
+ "in Matplotlib 3.3." )
4295
4299
4296
4300
if self .get_sketch_params () is not None :
4297
4301
gc .set_sketch_params (* self .get_sketch_params ())
You can’t perform that action at this time.
0 commit comments