Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 79b6e22

Browse filesBrowse files
authored
Merge pull request #19293 from QuLogic/fix-doc-interpolations
2 parents 6530db1 + 8deb721 commit 79b6e22
Copy full SHA for 79b6e22

File tree

Expand file treeCollapse file tree

2 files changed

+27
-11
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+27
-11
lines changed

‎doc/devel/documenting_mpl.rst

Copy file name to clipboardExpand all lines: doc/devel/documenting_mpl.rst
+22-7Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ this example from `matplotlib.lines`:
673673
.. code-block:: python
674674
675675
# in lines.py
676-
docstring.interpd.update(Line2D=artist.kwdoc(Line2D))
676+
docstring.interpd.update(Line2D_kwdoc=artist.kwdoc(Line2D))
677677
678678
Then in any function accepting `~.Line2D` pass-through ``kwargs``, e.g.,
679679
`matplotlib.axes.Axes.plot`:
@@ -686,13 +686,28 @@ Then in any function accepting `~.Line2D` pass-through ``kwargs``, e.g.,
686686
"""
687687
Some stuff omitted
688688
689-
The kwargs are Line2D properties:
690-
%(_Line2D_docstr)s
689+
Other Parameters
690+
----------------
691+
scalex, scaley : bool, default: True
692+
These parameters determine if the view limits are adapted to the
693+
data limits. The values are passed on to `autoscale_view`.
694+
695+
**kwargs : `.Line2D` properties, optional
696+
*kwargs* are used to specify properties like a line label (for
697+
auto legends), linewidth, antialiasing, marker face color.
698+
Example::
699+
700+
>>> plot([1, 2, 3], [1, 2, 3], 'go-', label='line 1', linewidth=2)
701+
>>> plot([1, 2, 3], [1, 4, 9], 'rs', label='line 2')
702+
703+
If you specify multiple lines with one plot call, the kwargs apply
704+
to all those lines. In case the label object is iterable, each
705+
element is used as labels for each set of data.
706+
707+
Here is a list of available `.Line2D` properties:
708+
709+
%(Line2D_kwdoc)s
691710
692-
kwargs scalex and scaley, if defined, are passed on
693-
to autoscale_view to determine whether the x and y axes are
694-
autoscaled; default True. See Axes.autoscale_view for more
695-
information
696711
"""
697712
698713
Note there is a problem for `~matplotlib.artist.Artist` ``__init__`` methods,

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ def inset_axes(self, bounds, *, transform=None, zorder=5, **kwargs):
352352

353353
return inset_ax
354354

355+
@docstring.dedent_interpd
355356
def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
356357
facecolor='none', edgecolor='0.5', alpha=0.5,
357358
zorder=4.99, **kwargs):
@@ -921,6 +922,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
921922
self._request_autoscale_view(scalex=False)
922923
return p
923924

925+
@docstring.dedent_interpd
924926
def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
925927
"""
926928
Add a vertical span (rectangle) across the Axes.
@@ -1497,10 +1499,9 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
14971499
>>> plot([1, 2, 3], [1, 2, 3], 'go-', label='line 1', linewidth=2)
14981500
>>> plot([1, 2, 3], [1, 4, 9], 'rs', label='line 2')
14991501
1500-
If you make multiple lines with one plot call, the kwargs
1501-
apply to all those lines.
1502-
In case if label object is iterable, each its element is
1503-
used as label for a separate line.
1502+
If you specify multiple lines with one plot call, the kwargs apply
1503+
to all those lines. In case the label object is iterable, each
1504+
element is used as labels for each set of data.
15041505
15051506
Here is a list of available `.Line2D` properties:
15061507

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.