Skip to content

Commit

Permalink
DOC: Improve doc wording of data parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
timhoffm committed Jun 15, 2024
1 parent 8b9cb14 commit 128ab72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1377,10 +1377,10 @@ def _add_data_doc(docstring, replace_names):

data_doc = ("""\
If given, all parameters also accept a string ``s``, which is
interpreted as ``data[s]`` (unless this raises an exception)."""
interpreted as ``data[s]`` if ``s`` is a key in ``data``."""
if replace_names is None else f"""\
If given, the following parameters also accept a string ``s``, which is
interpreted as ``data[s]`` (unless this raises an exception):
interpreted as ``data[s]`` if ``s`` is a key in ``data`:
{', '.join(map('*{}*'.format, replace_names))}""")
# using string replacement instead of formatting has the advantages
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,7 @@ def barh(self, y, width, height=0.8, left=None, *, align="center",
data : indexable object, optional
If given, all parameters also accept a string ``s``, which is
interpreted as ``data[s]`` (unless this raises an exception).
interpreted as ``data[s]`` if ``s`` is a key in data.
**kwargs : `.Rectangle` properties
Expand Down

0 comments on commit 128ab72

Please sign in to comment.