-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Update style sheet reference #21860
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
Conversation
timhoffm
commented
Dec 4, 2021
•
edited
Loading
edited
- Exclude internal styles (Closes Style sheet example should skip internal styles #21838)
- Make style names a bit larger and bold for better readability
- Use a different curve than sin for the plot lines with colorcycle. - The sin curves have a lot of crossing which makes it hard to follow the colorcycle. - I've still one crossing section included to make it look a bit more interesting, but we could even remove that in case somebody thinks this is still too cluttered.
Also make the style name a bit larger and bold so that it's easier to read.
The one change I made to make the style name a suptitle was more legible in my opinion. I also think it was better as one style so it looked the same for each figure. |
9aa28df
to
529225f
Compare
Yes, that's true. I've taken over your suptitles. |
mcolors.to_rgb(plt.rcParams['figure.facecolor']))[2] | ||
if back < 0.5: | ||
col = [0.8, 0.8, 1] | ||
fig.suptitle(style_label, x=0.01, fontsize=14, ha='left', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but many times the fontsizes are are different? https://65288-1385122-gh.circle-artifacts.com/0/doc/build/html/gallery/style_sheets/style_sheets_reference.html It think this is tight_layout
making the axes smaller or bigger and then css making all the figures the same size. I think if you switch to constrained_layout this will be better (tight_layout doesn't work with suptitles)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's try with constrained layout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That didn't work either. I don't really understand why the fontsize is not being respected...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main "problem" with the fontsize seems to be that the different styles define different figure sizes. E.g. compare
and
The fonts have actually the same size, but the poster is much larger, and thus the png is scaled down to fit in the available width in the theme.
The alternative would be to use an absolute figure size instead of a one relative rcParams['figure.size']
. Not sure which is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh weird. That hadn't occurred to me. I'd just make the figure a fixed size. That's essentially what we did w the subfigure version and I think that looked ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done:
It's better to override absolute sizes in the style sheet. Otherwise,
larger figure images are scaled down due to the limited available width
in the html theme. If we don't set a fixed size, we still don't get a size relation, but we
also have different magnifications due to the image scaling.
Notes:
- The width (7.4 -> 740px, assuming 100 dpi) is chosen to fit in the
HTML space (749px) without scaling. - The height is chosen to approximately keep the aspect ratio as before.
- The images are now significantly smaller than previously (all former
images were downscaled). We'll have to verify that the images still
look good given a lot of information and not much space. If not, we
need to add a fixed factor again. - All themes use figure.dpi=100, except "classic", which uses 80. Not
correcting for that is intentional. IMHO "classic" should come out
smaller to highlight the change in dpi.
with less overlapping lines to make the color cycle more obvious. Co-authored-by: Jody Klymak <jklymak@gmail.com>
529225f
to
b371463
Compare
It's better to override absolute sizes in the style sheet. Otherwise, larger figure images are scaled down due to the limited available width in the html theme. If not, we still don't get a size relation, but we also have different magnifications due to the image scaling. Notes: - The width (7.4 -> 740px, assuming 100 dpi) is chosen to fit in the HTML without scaling. - The size is chosen to approximately keep the aspect ratio as before. - The images are now significantly smaller than previously (all former images were downscaled). We'll have to verify that the images still look good given a lot of information and not much space. If not, we need to add a factor. - All themes use figure.dpi=100, except "classic", which uses 80. Not correcting for that is intentional. IMHO "classic" should come out smaller to highlight the change in dpi.
7131207
to
ad1b222
Compare
This looks fine to me. Feel free to self merge if you are done with it... |
…860-on-v3.5.x Backport PR #21860 on branch v3.5.x (DOC: Update style sheet reference)
…860-on-v3.5.1-doc Backport PR #21860 on branch v3.5.1-doc (DOC: Update style sheet reference)