Skip to content

Commit 12a2224

Browse files
committed
Remove some deprecated rcParams.
- axes.color_cycle was deprecated in 1.5 (68f0afb). - legend.isaxes was deprecated in 2.0 (64accfd). - svg.embed_char_paths was deprecated in 1.3.1 (6d660ce). - svg.image_noscale was deprecated in 2.1 (4a05302) but note that the deprecation was broken to start with as it used None as converter (so trying to set `rcParams["svg.image_noscale"]` currently raises `'NoneType' object is not callable`. - text.* and tick.size were deprecated before 1.3.1 (e34a333).
1 parent 7a6bab7 commit 12a2224

File tree

5 files changed

+14
-49
lines changed

5 files changed

+14
-49
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
@@ -843,23 +843,11 @@ def gen_candidates():
843843
# names of keys to deprecate
844844
# the values are a tuple of (new_name, f_old_2_new, f_new_2_old)
845845
# the inverse function may be `None`
846-
_deprecated_map = {
847-
'text.fontstyle': ('font.style', lambda x: x, None),
848-
'text.fontangle': ('font.style', lambda x: x, None),
849-
'text.fontvariant': ('font.variant', lambda x: x, None),
850-
'text.fontweight': ('font.weight', lambda x: x, None),
851-
'text.fontsize': ('font.size', lambda x: x, None),
852-
'tick.size': ('tick.major.size', lambda x: x, None),
853-
'svg.embed_char_paths': ('svg.fonttype',
854-
lambda x: "path" if x else "none", None),
855-
'axes.color_cycle': ('axes.prop_cycle', lambda x: cycler('color', x),
856-
lambda x: [c.get('color', None) for c in x]),
857-
'svg.image_noscale': ('image.interpolation', None, None),
858-
}
846+
_deprecated_map = {}
859847

860848
_deprecated_ignore_map = {}
861849

862-
_obsolete_set = {'text.dvipnghack', 'legend.isaxes'}
850+
_obsolete_set = {'text.dvipnghack'}
863851

864852
# The following may use a value of None to suppress the warning.
865853
_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
@@ -399,13 +399,6 @@ def validate_color(s):
399399
raise ValueError('%s does not look like a color arg%s' % (s, msg))
400400

401401

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

@@ -572,18 +565,6 @@ def validate_corner_mask(s):
572565
'center'], ignorecase=True)
573566

574567

575-
def deprecate_svg_image_noscale(value):
576-
warnings.warn("svg.image_noscale is deprecated. Set "
577-
"image.interpolation to 'none' instead.",
578-
mplDeprecation)
579-
580-
581-
def deprecate_svg_embed_char_paths(value):
582-
warnings.warn("svg.embed_char_paths is deprecated. Use "
583-
"svg.fonttype instead.",
584-
mplDeprecation)
585-
586-
587568
validate_svg_fonttype = ValidateInStrings('svg.fonttype',
588569
['none', 'path', 'svgfont'])
589570

@@ -1155,12 +1136,6 @@ def _validate_linestyle(ls):
11551136
'axes.formatter.useoffset': [True, validate_bool],
11561137
'axes.formatter.offset_threshold': [4, validate_int],
11571138
'axes.unicode_minus': [True, validate_bool],
1158-
'axes.color_cycle': [
1159-
['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728',
1160-
'#9467bd', '#8c564b', '#e377c2', '#7f7f7f',
1161-
'#bcbd22', '#17becf'],
1162-
deprecate_axes_colorcycle], # cycle of plot
1163-
# line colors
11641139
# This entry can be either a cycler object or a
11651140
# string repr of a cycler-object, which gets eval()'ed
11661141
# to create the object.
@@ -1351,10 +1326,7 @@ def _validate_linestyle(ls):
13511326

13521327
# write raster image data directly into the svg file
13531328
'svg.image_inline': [True, validate_bool],
1354-
# suppress scaling of raster data embedded in SVG
1355-
'svg.image_noscale': [False, deprecate_svg_image_noscale],
13561329
# True to save all characters as paths in the SVG
1357-
'svg.embed_char_paths': [True, deprecate_svg_embed_char_paths],
13581330
'svg.fonttype': ['path', validate_svg_fonttype],
13591331
'svg.hashsalt': [None, validate_string_or_None],
13601332

lib/matplotlib/tests/test_rcparams.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,6 @@ def test_Bug_2543():
160160
# real test is that this does not raise
161161
assert validate_bool_maybe_none(None) is None
162162
assert validate_bool_maybe_none("none") is None
163-
_fonttype = mpl.rcParams['svg.fonttype']
164-
assert _fonttype == mpl.rcParams['svg.embed_char_paths']
165-
with mpl.rc_context():
166-
mpl.rcParams['svg.embed_char_paths'] = False
167-
assert mpl.rcParams['svg.fonttype'] == "none"
168163

169164
with pytest.raises(ValueError):
170165
validate_bool_maybe_none("blah")

lib/matplotlib/tests/test_style.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def temp_style(style_name, settings=None):
4646

4747

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

0 commit comments

Comments
 (0)