Skip to content

Commit 6e7afec

Browse files
authored
Merge pull request #10028 from anntzer/remove-deprecated-rcparams
Remove some deprecated rcParams.
2 parents 8715f47 + 18b5c87 commit 6e7afec

File tree

5 files changed

+15
-50
lines changed

5 files changed

+15
-50
lines changed

doc/api/api_changes/2017-12-17-AL.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Removal of deprecated rcParams
2+
``````````````````````````````
3+
4+
The following deprecated rcParams have been removed:
5+
- ``axes.color_cycle`` (see ``axes.prop_cycle``),
6+
- ``legend.isaxes``,
7+
- ``svg.embed_char_paths`` (see ``svg.fonttype``),
8+
- ``text.fontstyle``, ``text.fontangle``, ``text.fontvariant``,
9+
``text.fontweight``, ``text.fontsize`` (renamed to ``text.style``, etc.),
10+
- ``tick.size`` (renamed to ``tick.major.size``).

lib/matplotlib/__init__.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -837,23 +837,11 @@ def gen_candidates():
837837
# names of keys to deprecate
838838
# the values are a tuple of (new_name, f_old_2_new, f_new_2_old)
839839
# the inverse function may be `None`
840-
_deprecated_map = {
841-
'text.fontstyle': ('font.style', lambda x: x, None),
842-
'text.fontangle': ('font.style', lambda x: x, None),
843-
'text.fontvariant': ('font.variant', lambda x: x, None),
844-
'text.fontweight': ('font.weight', lambda x: x, None),
845-
'text.fontsize': ('font.size', lambda x: x, None),
846-
'tick.size': ('tick.major.size', lambda x: x, None),
847-
'svg.embed_char_paths': ('svg.fonttype',
848-
lambda x: "path" if x else "none", None),
849-
'axes.color_cycle': ('axes.prop_cycle', lambda x: cycler('color', x),
850-
lambda x: [c.get('color', None) for c in x]),
851-
'svg.image_noscale': ('image.interpolation', None, None),
852-
}
840+
_deprecated_map = {}
853841

854842
_deprecated_ignore_map = {'nbagg.transparent': 'figure.facecolor'}
855843

856-
_obsolete_set = {'text.dvipnghack', 'legend.isaxes'}
844+
_obsolete_set = {'text.dvipnghack'}
857845

858846
# The following may use a value of None to suppress the warning.
859847
_deprecated_set = {'axes.hold'} # do NOT include in _all_deprecated

lib/matplotlib/rcsetup.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,6 @@ def validate_color(s):
397397
raise ValueError('%s does not look like a color arg%s' % (s, msg))
398398

399399

400-
def deprecate_axes_colorcycle(value):
401-
warnings.warn("axes.color_cycle is deprecated. Use axes.prop_cycle "
402-
"instead. Will be removed in 2.1.0",
403-
mplDeprecation)
404-
return validate_colorlist(value)
405-
406-
407400
validate_colorlist = _listify_validator(validate_color, allow_stringlist=True)
408401
validate_colorlist.__doc__ = 'return a list of colorspecs'
409402

@@ -577,18 +570,6 @@ def validate_corner_mask(s):
577570
'center'], ignorecase=True)
578571

579572

580-
def deprecate_svg_image_noscale(value):
581-
warnings.warn("svg.image_noscale is deprecated. Set "
582-
"image.interpolation to 'none' instead.",
583-
mplDeprecation)
584-
585-
586-
def deprecate_svg_embed_char_paths(value):
587-
warnings.warn("svg.embed_char_paths is deprecated. Use "
588-
"svg.fonttype instead.",
589-
mplDeprecation)
590-
591-
592573
validate_svg_fonttype = ValidateInStrings('svg.fonttype',
593574
['none', 'path', 'svgfont'])
594575

@@ -1160,12 +1141,6 @@ def _validate_linestyle(ls):
11601141
'axes.formatter.useoffset': [True, validate_bool],
11611142
'axes.formatter.offset_threshold': [4, validate_int],
11621143
'axes.unicode_minus': [True, validate_bool],
1163-
'axes.color_cycle': [
1164-
['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728',
1165-
'#9467bd', '#8c564b', '#e377c2', '#7f7f7f',
1166-
'#bcbd22', '#17becf'],
1167-
deprecate_axes_colorcycle], # cycle of plot
1168-
# line colors
11691144
# This entry can be either a cycler object or a
11701145
# string repr of a cycler-object, which gets eval()'ed
11711146
# to create the object.
@@ -1356,10 +1331,7 @@ def _validate_linestyle(ls):
13561331

13571332
# write raster image data directly into the svg file
13581333
'svg.image_inline': [True, validate_bool],
1359-
# suppress scaling of raster data embedded in SVG
1360-
'svg.image_noscale': [False, deprecate_svg_image_noscale],
13611334
# True to save all characters as paths in the SVG
1362-
'svg.embed_char_paths': [True, deprecate_svg_embed_char_paths],
13631335
'svg.fonttype': ['path', validate_svg_fonttype],
13641336
'svg.hashsalt': [None, validate_string_or_None],
13651337

lib/matplotlib/tests/test_rcparams.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ def test_Bug_2543():
142142
# real test is that this does not raise
143143
assert validate_bool_maybe_none(None) is None
144144
assert validate_bool_maybe_none("none") is None
145-
_fonttype = mpl.rcParams['svg.fonttype']
146-
assert _fonttype == mpl.rcParams['svg.embed_char_paths']
147-
with mpl.rc_context():
148-
mpl.rcParams['svg.embed_char_paths'] = False
149-
assert mpl.rcParams['svg.fonttype'] == "none"
150145

151146
with pytest.raises(ValueError):
152147
validate_bool_maybe_none("blah")

lib/matplotlib/tests/test_style.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def temp_style(style_name, settings=None):
4444
style.reload_library()
4545

4646

47-
def test_deprecated_rc_warning_includes_filename():
48-
SETTINGS = {'axes.color_cycle': 'ffffff'}
49-
basename = 'color_cycle'
47+
def test_invalid_rc_warning_includes_filename():
48+
SETTINGS = {'foo': 'bar'}
49+
basename = 'basename'
5050
with warnings.catch_warnings(record=True) as warns:
5151
with temp_style(basename, SETTINGS):
5252
# style.reload_library() in temp_style() triggers the warning

0 commit comments

Comments
 (0)