Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed07e05

Browse files
committed
Update docstrings for plot_directive.
- 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.
1 parent 4595bbd commit ed07e05

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
.. plot:: path/to/plot.py
1818
19-
This is the caption for the plot
19+
The plot's caption.
2020
2121
Additionally, one may specify the name of a function to call (with
2222
no arguments) immediately after importing the module::
@@ -36,6 +36,7 @@
3636
3. Using **doctest** syntax::
3737
3838
.. plot::
39+
3940
A plotting example:
4041
>>> import matplotlib.pyplot as plt
4142
>>> plt.plot([1, 2, 3], [4, 5, 6])
@@ -221,10 +222,7 @@ def mark_plot_labels(app, document):
221222

222223

223224
class PlotDirective(Directive):
224-
"""Implementation of the ``.. plot::`` directive.
225-
226-
See the module docstring for details.
227-
"""
225+
"""The ``.. plot::`` directive, as documented in the module's docstring."""
228226

229227
has_content = True
230228
required_arguments = 0

0 commit comments

Comments
 (0)