-
Notifications
You must be signed in to change notification settings - Fork 270
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
Change of style in matplotlib #3514
Comments
I do like the old look, and the context manager approach seems right. |
Agreed. I like the old look as well. Good job in spotting these changes! |
Note: I want to research the exact PR that changed that upstream. |
What a nice surprise this turned out to be (look who wrote issue 6518 !) So apparently the change of default math font actually dates back to MPL 2.0, see https://matplotlib.org/2.0.0/users/whats_new.html#change-in-default-font It is not clear why it only popped up in yt 5 years latter with MPL 3.4, but here is an issue that was closed on MPL 3.4.0
So maybe there's what we need to know there, and it's possible that the change of behaviour wasn't intentional after all and could be considered a MPL bug. I'll investigate this further another time. |
The change bisects to matplotlib/matplotlib#18862 |
Interesting. I don't understand why we're only just seeing it when it was merged almost a year ago. Is it because that only made it into a recent MPL release that we started using? |
The first release to contain the changing patch was 3.4.0, which wasn't released as long ago. At the time there were a couple worse incompatibilities to handle, so I set this one up aside. It was indeed more work to track it down and I'm a clearly not done yet. |
Follow up answer : turns out Nathan implemented custom parametrization inside yt to ensure style consistency without regards for matplotlib's defaults. Now because matplotlib introduced a new parameter with their 3.4 release, Nathan's implementation on the yt side needed a slight adjustment, but it turned out to be pretty easy once I figured out where it was. See #3520 |
Bug report
Bug summary
Matplotlib 3.4 came with a change in default math text font that affects how yt plots look by default. IMO the "classic" yt look is much nicer so I'd love that it stayed the default style as far as yt is concerned, with no regards to what matplotlib version is installed.
Code for reproduction
Here's a simple demo using yt 4.0 and matplotlib 3.4
Actual outcome
Expected outcome
This is the "classic yt" look that required no tweaking before Matplotlib 3.4
now it can be reproduced with any version of matplotlib with some additional effort on the user side.
this is the simplest way to do it, but unfortunately it has side effects, as it won't just change the settings for that one yt plot, but globally change how matplotlib looks through out the session.
Side effects can be avoided using a context manager
but this technique is IMO too disruptive.
I suggest we could use such context manager internally to restore yt's default look with no tweaking on the user side. In order to preserve flexibility (users should still be able to set a different font), some design decisions would be needed.
What do other users and developers think ?
Version Information
The text was updated successfully, but these errors were encountered: