-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cleanup scalarformatter.py example. #25968
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
Optional suggestion: Make the column titles more prominent by using a larger font size or bold font. Right now the titles look very similar to the tick labels and are thus a bit hard to see at first glance. |
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.
ax4.ticklabel_format(useMathText=True) | ||
|
||
fig.subplots_adjust(wspace=0.7, hspace=0.6) | ||
fig, axs = plt.subplots(4, 3, figsize=(9, 12), layout="constrained") |
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.
maybe move the rows a bit apart so that it's visually clearer that y-axis offsets pertain to the below and x-axis offsets to the above plot:
fig, axs = plt.subplots(4, 3, figsize=(9, 12), layout="constrained", gridspec_kw=dict(hspace=0.1))
axs[0, 0].set_title("default settings") | ||
axs[0, 1].set_title("no numerical offset") | ||
axs[0, 2].set_title("with mathtext") | ||
fig.align_ylabels() |
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 line can be removed - there are no y labels here
|
||
axs[0, 0].set_title("default settings") | ||
axs[0, 1].set_title("no numerical offset") | ||
axs[0, 2].set_title("with mathtext") |
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.
maybe vertically align titles (the last one is a bit higher due to the exponents in the offset):
axs[0, 0].set_title("default settings", y=1.1)
axs[0, 1].set_title("no numerical offset", y=1.1)
axs[0, 2].set_title("with mathtext", y=1.1)
Yeah similar to Tim's request, I'm having a hard time seeing the differences - maybe it's just the crowding on the figure - is there a way to put more space between subplot? Eta: what is the reason for showing each row? Eta2: agree with @StefRe, just didn't see it before I posted |
Thanks for the review, all comments handled. |
Move everything to a single figure for better comparability and remove repeated code.
thanks, slightly reworded and included the changes. |
Move everything to a single figure for better comparability and remove repeated code.
old: https://matplotlib.org/stable/gallery/ticks/scalarformatter.html

new:
PR summary
PR checklist