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

Skip to content

Commit 76426a0

Browse files
committed
DOC: Improve doc wording of data parameter
See #9844 (comment)
1 parent 8b9cb14 commit 76426a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,10 +1377,10 @@ def _add_data_doc(docstring, replace_names):
13771377

13781378
data_doc = ("""\
13791379
If given, all parameters also accept a string ``s``, which is
1380-
interpreted as ``data[s]`` (unless this raises an exception)."""
1380+
interpreted as ``data[s]`` if ``s`` is a key in ``data``."""
13811381
if replace_names is None else f"""\
13821382
If given, the following parameters also accept a string ``s``, which is
1383-
interpreted as ``data[s]`` (unless this raises an exception):
1383+
interpreted as ``data[s]`` if ``s`` is a key in ``data``:
13841384
13851385
{', '.join(map('*{}*'.format, replace_names))}""")
13861386
# using string replacement instead of formatting has the advantages

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,7 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
27442744
27452745
data : indexable object, optional
27462746
If given, all parameters also accept a string ``s``, which is
2747-
interpreted as ``data[s]`` (unless this raises an exception).
2747+
interpreted as ``data[s]`` if ``s`` is a key in ``data``.
27482748
27492749
**kwargs : `.Rectangle` properties
27502750

0 commit comments

Comments
 (0)