Skip to content

Display example figures in a single column #21837

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

Merged
merged 2 commits into from
Dec 4, 2021

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Dec 2, 2021

PR Summary

This overrides the sphinx-gallery CSS when multiple figures are output, so that they appear as a single column (except if they are already narrow enough to fit together.) In a few cases, it is possible to split up examples so that figures are not stuck together anyway, so do that where possible.

This generally looks better to me, even if a few figures get bunched up.

PR Checklist

Tests and Styling

  • [n/a] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [n/a] New features are documented, with examples if plot related.
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

This overrides sphinx-gallery's CSS to make multiple images appear
individually, which AFAICT looks better for all of our examples. It
affects the following:

- examples/axes_grid1/demo_axes_rgb.py
- examples/color/colormap_reference.py
- examples/color/named_colors.py
- examples/event_handling/pick_event_demo.py
- examples/event_handling/zoom_window.py
- examples/images_contours_and_fields/barb_demo.py
- examples/images_contours_and_fields/contourf_demo.py
- examples/images_contours_and_fields/image_demo.py
- examples/images_contours_and_fields/shading_example.py
- examples/lines_bars_and_markers/fill_betweenx_demo.py
- examples/specialty_plots/advanced_hillshading.py
- examples/statistics/boxplot_demo.py
- examples/style_sheets/style_sheets_reference.py
- examples/text_labels_and_annotations/accented_text.py
- examples/text_labels_and_annotations/annotation_demo.py
- examples/ticks/tick-formatters.py
- examples/userdemo/demo_gridspec03.py
- tutorials/colors/colormaps.py
- tutorials/colors/colors.py
Turning of multi-column display of figures in docs shows some examples
that really should have been split apart. Most already have text that
could go in the space between the figures, too.
@jklymak
Copy link
Member

jklymak commented Dec 2, 2021

For some reason the Artifact isn't found...

@QuLogic
Copy link
Member Author

QuLogic commented Dec 2, 2021

Ah sorry, that's because I enabled Circle on my fork to test out the backport checks. Here's the direct link: https://80-21548241-gh.circle-artifacts.com/0/doc/build/html/index.html

@timhoffm timhoffm added this to the v3.5-doc milestone Dec 3, 2021
@timhoffm
Copy link
Member

timhoffm commented Dec 3, 2021

Can we backport this to 3.5-doc or does that not work because there are changes in the examples?

Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

I'm not too sure what branch this should go on, so will hold off merging. @QuLogic feel free to choose a branch and self merge

@QuLogic
Copy link
Member Author

QuLogic commented Dec 4, 2021

Only stuff that changes installed files shouldn't be backported, so this is fine.

@QuLogic QuLogic merged commit fc4f0cc into matplotlib:main Dec 4, 2021
@QuLogic QuLogic deleted the onecol-doc-images branch December 4, 2021 01:31
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Dec 4, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Dec 4, 2021
QuLogic added a commit that referenced this pull request Dec 4, 2021
…837-on-v3.5.x

Backport PR #21837 on branch v3.5.x (Display example figures in a single column)
QuLogic added a commit that referenced this pull request Dec 4, 2021
…837-on-v3.5.0-doc

Backport PR #21837 on branch v3.5.0-doc (Display example figures in a single column)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants