Skip to content

Commit 981d8cd

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). - text.* and tick.size were deprecated before 1.3.1 (e34a333).
1 parent 7a6bab7 commit 981d8cd

File tree

4 files changed

+13
-33
lines changed

4 files changed

+13
-33
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: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -844,22 +844,12 @@ def gen_candidates():
844844
# the values are a tuple of (new_name, f_old_2_new, f_new_2_old)
845845
# the inverse function may be `None`
846846
_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]),
857847
'svg.image_noscale': ('image.interpolation', None, None),
858848
}
859849

860850
_deprecated_ignore_map = {}
861851

862-
_obsolete_set = {'text.dvipnghack', 'legend.isaxes'}
852+
_obsolete_set = {'text.dvipnghack'}
863853

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

lib/matplotlib/rcsetup.py

Lines changed: 0 additions & 20 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

@@ -578,12 +571,6 @@ def deprecate_svg_image_noscale(value):
578571
mplDeprecation)
579572

580573

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-
587574
validate_svg_fonttype = ValidateInStrings('svg.fonttype',
588575
['none', 'path', 'svgfont'])
589576

@@ -1155,12 +1142,6 @@ def _validate_linestyle(ls):
11551142
'axes.formatter.useoffset': [True, validate_bool],
11561143
'axes.formatter.offset_threshold': [4, validate_int],
11571144
'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
11641145
# This entry can be either a cycler object or a
11651146
# string repr of a cycler-object, which gets eval()'ed
11661147
# to create the object.
@@ -1354,7 +1335,6 @@ def _validate_linestyle(ls):
13541335
# suppress scaling of raster data embedded in SVG
13551336
'svg.image_noscale': [False, deprecate_svg_image_noscale],
13561337
# True to save all characters as paths in the SVG
1357-
'svg.embed_char_paths': [True, deprecate_svg_embed_char_paths],
13581338
'svg.fonttype': ['path', validate_svg_fonttype],
13591339
'svg.hashsalt': [None, validate_string_or_None],
13601340

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)