Skip to content

Commit

Permalink
Update docstrings for plot_directive.
Browse files Browse the repository at this point in the history
- Small edit to PlotDirective's docstring.
- In the module's docstring, avoid having tokens ("is", "for") that
  would get misthighlighted as Python keywords.  I did not move the
  entire block into a `.. code-block:: rst` because there are later
  cases where we show a python snippet under `.. plot::`, in which
  case having Python syntax highlighting is actually nicer.
  • Loading branch information
anntzer committed Mar 6, 2020
1 parent 4595bbd commit ed07e05
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/matplotlib/sphinxext/plot_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.. plot:: path/to/plot.py
This is the caption for the plot
The plot's caption.
Additionally, one may specify the name of a function to call (with
no arguments) immediately after importing the module::
Expand All @@ -36,6 +36,7 @@
3. Using **doctest** syntax::
.. plot::
A plotting example:
>>> import matplotlib.pyplot as plt
>>> plt.plot([1, 2, 3], [4, 5, 6])
Expand Down Expand Up @@ -221,10 +222,7 @@ def mark_plot_labels(app, document):


class PlotDirective(Directive):
"""Implementation of the ``.. plot::`` directive.
See the module docstring for details.
"""
"""The ``.. plot::`` directive, as documented in the module's docstring."""

has_content = True
required_arguments = 0
Expand Down

0 comments on commit ed07e05

Please sign in to comment.