Replies: 1 comment 2 replies
-
I think QuiverPlots (or ArrowPlots, which makes more sense to me as a name even though it doesn't match matplotlib) would be an easy addition as there is a lot of overlap with BarbPlots, and the only additional feature I can imagine would be the ability to draw a reference vector. But I haven't tried to implement that so I could be wrong! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to connect the dots between my recent discussion posts/issues (#1707, #1709, and #1710) and some previously suggested ideas (xref #1016, old MetPy roadmap) to try outlining some new plot types for declarative I'd love to see happen, and how to get there.
cc @kgoebber, since I know you've put a lot of thought into working with declarative, but I'm not sure what you've planned out as far as future extensions go. Hopefully none of this conflicts too much with anything you already have!
Plot Types
Some possible APIs
Again, this is just brainstorming. If there are improvements, please do suggest your own ideas/thoughts! Also, the various interfaces are worked out to varying levels of detail, but hopefully all are at least sufficient as a conversation starter.
SkewTs and Hodographs
SkewTPanel
Represent the SkewT axes, to which multiple "profile plots" can be attached.
rotation
: float or int as in constructor for non-declarative versionaspect
: float, int, or 'auto' as in constructor for non-declarative versiontitle
: as inMapPanel
layout
: as inMapPanel
(however, see Support complex layouts in declarative interface using GridSpec and/or subplot_mosaic #1707)xlim
: 2-tuple of float or int, to set the temperature axis limitsylim
: 2-tuple of float or int, to set pressure axis limitslayers
: list from among the followingSkewT.plot_dry_adiabats
)SkewT.plot_mixing_lines
)SkewT.plot_moist_adiabats
)matplotlib.collections.LineCollection
)HodographPanel
Represent the Hodograph axes, to which multiple "profile plots" can be attached.
component_range
float or int, as in constructor for non-declarative versiongrid
: from among the followingProfilePlot
A general base class for vertical profiles of data (hopefully can also be used directly for single scalar profiles). Similar to the existing
Plots2D
orPlotScalar
, but for 1D profiles and with more generic extensibility to the other types below.MultiProfilePlot
To reduce lines of code for common use cases and to effectively handle regions that require multiple profiles, have a plotting class that deals with combinations of profiles, such as:
"Automagic" interpretation of temperature and parcel profile (e.g., when using output from
mpcalc.parcel_profile_with_lcl_as_dataset
) to enable cape/cin shading when enabled by a trait.VelocityProfilePlot
Base class for vertical profiles of velocity data below
Also the intended primary plot type for hodographs (and so, will need options for colormapping as well)
BarbProfilePlot
Barb profile for a SkewT
QuiverProfilePlot
Arrows, not barbs, such as that used for extra detail in hodographs
Overlay plots
OverlayPlot
Base class, not intended to be used directly. Initial ideas for control traits/properties:
start
,stop
,skip
: arguments for controlling spacing based on integer index of data coordinates (can probably auto-compute smart defaults based on aspect ratio and fitting x number of figures in the shortest figure dimension)origin
: how to align the inset figure to the data point it originates frommask
: region in the 2D map plane on which to either include or exclude overlay diagramsFeedback request (@jsillin, @nixoncameronj, @mwilson14): what kind of location/layout controls would you like to see in a generalized version of your overlay plots?
Another area for thought/feedback: how do we specify the data to these in a way that is easy to use and flexible enough for diverse use cases? My thought was having users feed in a profile plot as defined in the SkewT/Hodograph section above to this plot class, like so:
The key idea is "this is both a plot (you give it to panel) and a panel (you put plots on it)".
If this idea of having to feed a plot to another plot goes against the intended philosophy, and that the data should be specified more directly, then I think we either need to have "magic" internals that automatically handle the different data types (at the risk of inflexibility), or create more explicit plot classes (at the risk of too many combinatoral possibilities)
HodographOverlayPlot
Does what is says, essentially combining OverlayPlot with HodographPanel. Specific design highly dependent upon issues raised for the general
OverlayPlot
above.SkewTOverlayPlot
Does what is says, essentially combining OverlayPlot with SkewTPanel. Specific design highly dependent upon issues raised for the general
OverlayPlot
above.Cross Sections and Hovmoller Diagrams
I really hope that the ideas proposed in #1709 to generalize the 2D plot classes can come to fruition, since that would make these pretty straightforward (just defining some simple new panel types):
CrossSectionPanel
title
,plots
,layout
as inMapPanel
bounds
, the analog toarea
inMapPanel
to control the extent (or should it be split xlim/ylim like SkewTs?)layers
, optionally specify terrain mask (though, that opens a whole can of worms with specifying sufficient data to carry out needed vertical coordinate transforms)Also, I'm not sure the best way to map this to a property/trait, but having an easy way to control the x axis labels (such as x coord, y coord, lat, lon, distance, or any combination thereof) while also providing smart defaults would be ideal.
HovmollerPanel
Should be really easy, as the selection of coords is all handled through the generalized 2D plots (and any spatial aggregations prior to that in xarray). This may even be the case where a "GenericPanel" could be a better option instead (since there isn't anything really axes type specific here)
title
,plots
,layout
as inMapPanel
bounds
, the analog toarea
inMapPanel
to control the extent (or should it be split xlim/ylim like SkewTs?)Even More Extensions!
The following additional types have been listed as previous suggestions, but I haven't given them much thought. So, I'll list them for completeness and ask that anyone else who wants to follow up on enumerating plans/possible APIs do so!
Beta Was this translation helpful? Give feedback.
All reactions