-
Notifications
You must be signed in to change notification settings - Fork 416
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
Place Skew-T's On Figure Using Data Coordinates #1706
Comments
I think the best way to do this would be supporting However, that doesn't preclude also including more helpers for these kinds of "diagram overlay" plots for SkewTs and hodographs. I'm a big fan of these kinds of plots by you and @nixoncameronj, and would love to see a well-tested, openly-released implementation in MetPy or another MetPy-adjacent package. |
Ugh, I forgot if transform is None:
transform = self.transAxes
kwargs.setdefault('label', 'inset_axes')
# This puts the rectangle into figure-relative coordinates.
inset_locator = _make_inset_locator(bounds, transform, self)
bb = inset_locator(None, None)
inset_ax = Axes(self.figure, bb.bounds, zorder=zorder, **kwargs)
# this locator lets the axes move if in data coordinates.
# it gets called in `ax.apply_aspect() (of all places)
inset_ax.set_axes_locator(inset_locator)
self.add_child_axes(inset_ax)
return inset_ax I wonder if we could do a Like @jthielen said, In general @jsillin we very much want to help facilitate these kinds of plots in MetPy, I think they're super cool and interesting. |
Thanks @dopplershift! I will admit that talk of initializers and classmethods is still a little over my head, but I'm excited to see what y'all can come up with as a solution :) I would love to publish this code and possibly add it to the example catalogue for others to use and tinker with and learn from, but it needs some serious cleaning up haha. Thanks again for giving this some thought! Really appreciate it |
See #1708 for a first pass at implementing @dopplershift's suggestion above. |
I recently have been using MetPy's excellent SkewT plotting tool to create plots overlaying a bunch of skew-ts over a region to easily assess the spatial variability of thermodynamic and moisture profiles:
Currently, the part of the SkewT plotting line that allows placement of the SkewT axes on the bigger figure uses figure-relative coordinates [0,1]
skew = SkewT(fig=fig,rect=(0.75,0.7,.15,.1))
This gets tricky when doing a whole bunch of these plots because I want to tie the location of the SkewT axes on the bigger figure to a physically-meaningful location (the lat/lon coordinates from which I am pulling the sounding data).
I was wondering if there would be a way to add an option for setting this location similar to Matplotlib's ax.text method which takes lon,lat as the first two arguments to set the position of text on an axis that has lat/lon coordinates.
Maybe this could be a kwarg added onto the rect method where if you say latlon=True, your first two arguments to rect can be a lat/lon for placing the skewT plot.
The text was updated successfully, but these errors were encountered: