29
29
except ImportError :
30
30
# python 2
31
31
import collections as abc
32
+
33
+ from matplotlib .cbook import mplDeprecation
32
34
from matplotlib .fontconfig_pattern import parse_fontconfig_pattern
33
35
from matplotlib .colors import is_color_like
34
36
@@ -149,7 +151,8 @@ def deprecate_axes_hold(value):
149
151
if value is None :
150
152
return None # converted to True where accessed in figure.py,
151
153
# axes/_base.py
152
- warnings .warn ("axes.hold is deprecated, will be removed in 3.0" )
154
+ warnings .warn ("axes.hold is deprecated, will be removed in 3.0" ,
155
+ mplDeprecation )
153
156
return validate_bool (value )
154
157
155
158
@@ -284,7 +287,8 @@ def validate_maskedarray(v):
284
287
except ValueError :
285
288
pass
286
289
warnings .warn ('rcParams key "maskedarray" is obsolete and has no effect;\n '
287
- ' please delete it from your matplotlibrc file' )
290
+ ' please delete it from your matplotlibrc file' ,
291
+ mplDeprecation )
288
292
289
293
290
294
_seq_err_msg = ('You must supply exactly {n} values, you provided {num} '
@@ -405,7 +409,8 @@ def validate_color(s):
405
409
406
410
def deprecate_axes_colorcycle (value ):
407
411
warnings .warn ("axes.color_cycle is deprecated. Use axes.prop_cycle "
408
- "instead. Will be removed in 2.1.0" )
412
+ "instead. Will be removed in 2.1.0" ,
413
+ mplDeprecation )
409
414
return validate_colorlist (value )
410
415
411
416
@@ -480,7 +485,8 @@ def validate_whiskers(s):
480
485
481
486
def deprecate_savefig_extension (value ):
482
487
warnings .warn ("savefig.extension is deprecated. Use savefig.format "
483
- "instead. Will be removed in 1.4.x" )
488
+ "instead. Will be removed in 1.4.x" ,
489
+ mplDeprecation )
484
490
return value
485
491
486
492
@@ -541,7 +547,8 @@ def validate_negative_linestyle_legacy(s):
541
547
except ValueError :
542
548
dashes = validate_nseq_float (2 )(s )
543
549
warnings .warn ("Deprecated negative_linestyle specification; use "
544
- "'solid' or 'dashed'" )
550
+ "'solid' or 'dashed'" ,
551
+ mplDeprecation )
545
552
return (0 , dashes ) # (offset, (solid, blank))
546
553
547
554
@@ -554,7 +561,8 @@ def validate_corner_mask(s):
554
561
555
562
def validate_tkpythoninspect (s ):
556
563
# Introduced 2010/07/05
557
- warnings .warn ("tk.pythoninspect is obsolete, and has no effect" )
564
+ warnings .warn ("tk.pythoninspect is obsolete, and has no effect" ,
565
+ mplDeprecation )
558
566
return validate_bool (s )
559
567
560
568
validate_legend_loc = ValidateInStrings (
@@ -574,12 +582,14 @@ def validate_tkpythoninspect(s):
574
582
575
583
def deprecate_svg_image_noscale (value ):
576
584
warnings .warn ("svg.image_noscale is deprecated. Set "
577
- "image.interpolation to 'none' instead." )
585
+ "image.interpolation to 'none' instead." ,
586
+ mplDeprecation )
578
587
579
588
580
589
def deprecate_svg_embed_char_paths (value ):
581
590
warnings .warn ("svg.embed_char_paths is deprecated. Use "
582
- "svg.fonttype instead." )
591
+ "svg.fonttype instead." ,
592
+ mplDeprecation )
583
593
584
594
585
595
validate_svg_fonttype = ValidateInStrings ('svg.fonttype' ,
0 commit comments