Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Add summary lines to plot types #27929

Merged
merged 2 commits into from
Mar 20, 2024
Merged

Conversation

timhoffm
Copy link
Member

IMHO it's meaningful to give a one-sentence summary on the individual pages, e.g. at
https://matplotlib.org/stable/plot_types/basic/plot.html#sphx-glr-plot-types-basic-plot-py

Plot y versus x as lines and/or markers.

See plot.

is more helpful than just

See plot.

Users can already decide if that's the correct function for them and whether it's worth following the link. Also, the first sentence is used in the tooltip on the index page, where the current "See ..." is not helpful.

grafik

I believe it's ok to just copy the text. Automatic insertion or check for consistency are not worth the added complexity. First, these summary lines change rarely. Second, even if we improve the method summary and forget to udpate here, nothing really bad happens; we've maybe a slightly less optimal description here, but that's still way better than no description at all.

Semi-OT: I changed the barbs summary from

Plot a 2D field of barbs.

to

Plot a 2D field of wind barbs.

because, AFAIK these are only used for wind, and that makes the context more clear. People outside of metrology may not know what barbs are so giving that extra context is reasonable.

@github-actions github-actions bot added the Documentation: plot types files in galleries/plot_types label Mar 15, 2024
Copy link
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally think this is a good idea/is better than just the link out. Going back and forth on wind barb b/c technically I think it's just a glyph that encodes magnitude and direction, but also yes it's conventionally used for wind.

galleries/plot_types/basic/stackplot.py Outdated Show resolved Hide resolved
IMHO it's meaningful to give a one-sentence summary on the individual
pages, e.g. at
https://matplotlib.org/stable/plot_types/basic/plot.html#sphx-glr-plot-types-basic-plot-py

> Plot y versus x as lines and/or markers.
>
> See `plot`.

is more helpful than just

> See `plot`.

Users can already decide if that's the correct function for them and
whether it's worth following the link. Also, the first sentence is used
in the tooltip on the index page, where the current "See ..." is not
helpful.

I believe it's ok to just copy the text. Automatic insertion or check
for consistency are not worth the added effort. First, these summary
lines change rarely. Second, even if we improve the method summary and
forget to udpate here, nothing really bad happens; we've maybe a
slightly less optimal description here, but that's still way better than
no description at all.

Semi-OT: I changed the barbs summary from

> Plot a 2D field of barbs.

to

> Plot a 2D field of wind barbs.

because, AFAIK these are only used for wind, and that makes the context
more clear. People outside of metrology may not know what barbs are
so giving that extra context is reasonable.
@@ -2,6 +2,7 @@
==============
stairs(values)
==============
A stepwise constant function as a line with bounding edges or a filled plot.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be silly but I think if we do this then the language should be obnouxisly consistent - the other descriptions start "Plot/Draw/Create"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the risk of going off-topic and getting bogged down, I've changed the summary line for stairs().

@story645 story645 added this to the v3.9.0 milestone Mar 19, 2024
@QuLogic QuLogic merged commit e20ce21 into matplotlib:main Mar 20, 2024
43 checks passed
@timhoffm timhoffm deleted the doc-plot-types branch March 20, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: plot types files in galleries/plot_types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants