doc: mention bar_label in bar and barh#31395
doc: mention bar_label in bar and barh#31395turbotimon wants to merge 1 commit intomatplotlib:mainfrom
bar_label in bar and barh#31395Conversation
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process. You can also join us on gitter for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
|
|
||
| label : str or list of str, optional | ||
| A single label is attached to the resulting `.BarContainer` as a | ||
| label for the whole dataset. |
There was a problem hiding this comment.
| legend label for the whole dataset. |
In general, "label" on Artist is the legend label, but since we have legend labels and labels on the bars, it's better to be explicit here.
| and will cause repeated label entries, so this is best used when | ||
| bars also differ in style (e.g., by passing a list to *color*.) | ||
| bars also differ in style (e.g., by passing a list to *color*). | ||
| Use `.bar_label` to add labels to bars. |
There was a problem hiding this comment.
I'm still undecided whether. this addition is reasonable. On the one hand it's off-topic because here we are only concerned with the legend. On the other hand, it might be a reasonable cross-link.
If we do this I'd go with
| Use `.bar_label` to add labels to bars. | |
| Tip: Use `.bar_label` to place labels on the bars. |
i.e. use more specific language "place on" instead of "add to"; move this to a separate paragraph and use the "Tip:" prefix to set it logically and visually apart. I've intentionally used plain-text Tip: and not an admonition, because an admonition would give this too much visual weight.
PR summary
Improves:
Minimal and previously missing information has been added on how to use
bar_labelto add labels to bars forbarandbarh.Motivation:
I was looking for this functionality, but couldn’t find any information about it in the documentation for
barorbarh. Only an LLM was able to tell me thatbar_labelexists. I think this should be mentioned in these descriptions, sincebar_labelis specific to these functions.** "Good first issue":**
Since this is my first contribution, let me know if something is missing or needs to be improved
AI Disclosure
No AI
PR checklist