-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix and clean up Skew-T example #7479
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
For some reason, `_adjust_location()` on the `SkewSpine` was not being called; this resulted in `SkewXAxis` having the default (and out of date) bounds for the upper x-axis. Not sure what the root cause is, but refactoring this so that it isn't relying on the Spine to modify attributes on the XAxis both fixes the problem and cleans up the design greatly.
With 2.0, we now get minor ticks on log plots that don't span a full decade (like this one if we go 1000 to 100). Just turn them off.
Grab some other colors out of the default cycle so that temp is red, dewpoint is green, and the slanted line is blue.
Make it match the refactoring on the example.
I think I have a few more things to do here... |
Matches the work done in matplotlib/matplotlib#7479, which fixes missing gridlines identified in matplotlib/matplotlib#6873. This is a cleaner implementation of how this is handled anyways.
Matches the work done in matplotlib/matplotlib#7479, which fixes missing gridlines identified in matplotlib/matplotlib#6873. This is a cleaner implementation of how this is handled anyways.
Refactor so that ticks, labels, and gridlines are controlled using their flags, compensating for data ranges, rather than a hard-coded check in the draw method. This fixes figures with a bunch of whitespace when using bbox_inches='tight'. Also add this refactor to the test.
Ok, should be good now. |
Matches the work done in matplotlib/matplotlib#7479, which fixes missing gridlines identified in matplotlib/matplotlib#6873. This is a cleaner implementation of how this is handled anyways.
Such an implementation already exists for update_position(), add some for these methods for clarity and to help users who want to be able to follow them from where they're called (like in an IDE).
Previous fixes broke upper ticks so that they never showed up. This comes from checking the default position, 0, against the upper range. Instead, use a sentinel of None for the default position. If a tick has the default position, avoid checking against the interval.
Ok, this latest change should fix the test--it turns out I had broken upper tick marks. I had to add an implementation of |
Why don't we ship those tick classes as part of the library (or farm them out into a installable package)? |
I maintain copies of this over in Unidata/MetPy--I'm not sure they're general enough to warrant a smaller package. IMO, they're here as an example of what you can really dig into with custom Axes, etc. |
I have merged this because it fixes problems and seems unlikely to create any new ones; any refactoring, splitting functionality out, generalizing it, etc. can be left for the next release. |
As far as making something standardized goes, I'd like to see what we can do to solve this problem in a general sense; most of the code in SkewT for the spines, ticks, etc. only exists to handle the fact that the data range for this transform is no longer a box. |
Matches the work done in matplotlib/matplotlib#7479, which fixes missing gridlines identified in matplotlib/matplotlib#6873. This is a cleaner implementation of how this is handled anyways.
The main purpose is to address the gridline initial draw issue in #6873--which is achieved by refactoring and not doing some horrible things with mutable state. (Setting state directly was faster, but who cares about a 250x slowdown when the attribute access time is measured in microseconds either way?)
While I'm at it, I've updated for 2.x: improved the colors and addressed potential problems with minor log ticks showing up. I also updated the skew test to match the example's new design.