Skip to content

Plot style sheet reference on a single figure #21782

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

dstansby
Copy link
Member

@dstansby dstansby commented Nov 28, 2021

Fixes #21734. It looks like sphinx gallery forces multiple figures to be in two columns in their CSS (possibly disabling that should be an upstream feature request?), so just changing figure sizes doesn't work.

Instead I've changed it to be plotted on a single figure and lots of subplots - not ideal if plotting locally, but better for the gallery.

@dstansby dstansby changed the title Use a consistent figure size for style sheet reference Plot style sheet reference on a single figure Nov 28, 2021
@jklymak
Copy link
Member

jklymak commented Nov 29, 2021

https://65139-1385122-gh.circle-artifacts.com/0/doc/build/html/gallery/style_sheets/style_sheets_reference.html#sphx-glr-gallery-style-sheets-style-sheets-reference-py

The problem with this approach is that the style sheets set some figure properties. Note that the dark backgrounds are not being set.

I wonder if stylesheets can be applied on a per-subfigure basis?

I think these need an annotation to make the style clear. Yes, its on the yaxis of the first plot, but you really need to squint to see it.

Finally, they are a bit awkwardly tall, and there is perhaps excessive white space that I would try to use constrained_layout=True.

@dstansby
Copy link
Member Author

Oh yes, of course 🤦 . I think the right way to go is try and solve this upstream with sphinx gallery - see #21734 (comment)

@dstansby dstansby closed this Nov 29, 2021
@dstansby dstansby deleted the style-example branch November 29, 2021 11:06
@jklymak
Copy link
Member

jklymak commented Nov 29, 2021

I think using subfigures works fine if you set the facecolor by hand.

@jklymak jklymak mentioned this pull request Nov 29, 2021
6 tasks
@timhoffm
Copy link
Member

timhoffm commented Dec 1, 2021

If it’s just CSS (#21734 (comment)), it’s trivial to patch it our side. The upstream fix is slightly more complicated because you’ll likely want to make this configurable, but still not a big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Doc]: Stylesheet reference is too small in new website layout
3 participants