Skip to content

Commit 189dba3

Browse files
authored
Merge pull request #20540 from anntzer/enc
Deprecate :encoding: option to .. plot::, which has no effect since 2011
2 parents 2e2cbd0 + babdac4 commit 189dba3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``:encoding:`` option to ``.. plot`` directive
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
This option has had no effect since Matplotlib 1.3.1, and is now deprecated.

lib/matplotlib/sphinxext/plot_directive.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ def _option_format(arg):
196196
return directives.choice(arg, ('python', 'doctest'))
197197

198198

199+
def _deprecated_option_encoding(arg):
200+
_api.warn_deprecated("3.5", "encoding", obj_type="option")
201+
return directives.encoding(arg)
202+
203+
199204
def mark_plot_labels(app, document):
200205
"""
201206
To make plots referenceable, we need to move the reference from the
@@ -244,7 +249,7 @@ class PlotDirective(Directive):
244249
'format': _option_format,
245250
'context': _option_context,
246251
'nofigs': directives.flag,
247-
'encoding': directives.encoding,
252+
'encoding': _deprecated_option_encoding,
248253
'caption': directives.unchanged,
249254
}
250255

0 commit comments

Comments
 (0)