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

POC: add minigallery to plot types: bar #27512

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

Closed
wants to merge 1 commit into from

Conversation

story645
Copy link
Member

@story645 story645 commented Dec 14, 2023

PR summary

Honestly not sure if adding mini galleries to the bottom would be helpful or feel cluttered (we can do basically the same thing w/ tags and tags allow for better curation) but trying it out here. Before this gets fully implemented I would try to fix the double listing in sphinx gallery. Also, I think thumbnail would have to go before code for this to be readable.

image

PR checklist

@story645 story645 added status: needs comment/discussion needs consensus on next step Documentation: plot types files in galleries/plot_types labels Dec 14, 2023
@timhoffm
Copy link
Member

My 2cents: To me this looks a bit cluttered.

Semi-OT: The overview page https://matplotlib.org/stable/plot_types/index is great. However, I don't see much benefit in the individual plot type pages like https://matplotlib.org/stable/plot_types/basic/plot.html.

They contain

  • a link to the method
  • The plot again, which is already on the overview page.
  • quite a bit boilerplate code to generate the plot. this is mostly data and song-and-dance to make the plot more pictographic (square, hide axes labels etc.) It's not representative code example how you would typically use the function.

In sum, IMHO, there is no relevant content apart from the link.

From a UX perspective, I would find it more straight forward to link from the overview page directly to the methods. This of course would mean, Sphinx gallery is not the right tool anymore. Instead, one would likely have to pre-render the plots and lay them out e.g. with Sphinx-design. The mini-galleries are useful, but I think they belong to the method (=all related content in one place).

Note: One could put the creation of all the plots in a single example "Plot icons" (under examples), which would

  • explain how one creates this type plots
  • serves as the generation code for the pre-rendered plots mentioned above.

@story645
Copy link
Member Author

I think the pages would flow better as graphic then code & I like the idea of one very stripped down example that shows just plotting one data set and very simple labeling. Mostly cause many of our examples have the opposite problem - doing too many things so it's hard to parse out the one thing.

In sum, IMHO, there is no relevant content apart from the link.

Yeah, that's why I was thinking of adding the min-galleries, so they can act as a kind of TOC into the examples - but we can also achieve this with tags.

From a UX perspective, I would find it more straight forward to link from the overview page directly to the methods

It's probably too hard to do & may not make any sense, but I kinda wish we could put each method on its own page. Both because some of the methods (like hist) have so much information, and because mini-galleries at the bottom of each of those pages would make sense. Also would not be opposed to (and I think this we can do) the gallery page having the pretty thumbnails, but the individual pages having the most basic w/ all the Matplotlib defaults, no special labeling, form.

@story645
Copy link
Member Author

Instead, one would likely have to pre-render the plots

I think we can maybe do this using the plot directive + just use the sphinx gallery thumbnail directive + thumbnail parent div directive ....

@jklymak
Copy link
Member

jklymak commented Dec 15, 2023

I also think this suggestion is too cluttered - "see bar" leads to the same gallery of related examples, so this would be redundant.

I like the small example for each page. It's helpful in its own right, and links the method both explicitly, and in the code if people need the in-depth documentation.

If we want the best of both worlds, maybe a link to https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#examples-using-matplotlib-axes-axes-bar would be a reasonable thing to add next to the API link? (eg. More examples <../..//api/_as_gen/matplotlib.axes.Axes.bar.html#examples-using-matplotlib-axes-axes-bar>_)

@story645
Copy link
Member Author

If we want the best of both worlds, maybe a link to https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar.html#examples-using-matplotlib-axes-axes-bar would be a reasonable thing to add next to the API link? (eg. More examples <../..//api/as_gen/matplotlib.axes.Axes.bar.html#examples-using-matplotlib-axes-axes-bar>)

Tagging this ..plot_type:bar will achieve the same end - all that's waiting on is melissawm/sphinx-tags#84 getting merged & a new release of sphinx-tags, but I can start batching the tagging PRs assuming that PR goes in.

@story645 story645 closed this Jan 17, 2024
@story645 story645 deleted the plot-type-minigallery branch May 2, 2024 16:03
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 status: needs comment/discussion needs consensus on next step
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.