Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/api/next_api_changes/deprecations/20540-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
``:encoding:`` option to ``.. plot`` directive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This option has had no effect since Matplotlib 1.3.1, and is now deprecated.
7 changes: 6 additions & 1 deletion lib/matplotlib/sphinxext/plot_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ def _option_format(arg):
return directives.choice(arg, ('python', 'doctest'))


def _deprecated_option_encoding(arg):
_api.warn_deprecated("3.5", "encoding", obj_type="option")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering the error in #20543, it looks like this is missing a name=?

return directives.encoding(arg)


def mark_plot_labels(app, document):
"""
To make plots referenceable, we need to move the reference from the
Expand Down Expand Up @@ -242,7 +247,7 @@ class PlotDirective(Directive):
'format': _option_format,
'context': _option_context,
'nofigs': directives.flag,
'encoding': directives.encoding,
'encoding': _deprecated_option_encoding,
'caption': directives.unchanged,
}

Expand Down