Multiplotting overhaul#49
Merged
Merged
Conversation
this does break derived field variables somewhat, which no longer have a way to signal new dimensions
The node-graph / DataWorld / WorldAdaptor / PlotInfo refactor on this branch diverged from the documented (main) design. Rewrites the data flow, adaptor hierarchy, and data-wrapper sections and adds PlotTarget, PlotInfo/AxesManager, and Hook sections to match. Co-Authored-By: Claude <noreply@anthropic.com>
Dead code: isinstance2 was never imported anywhere. Co-Authored-By: Claude <noreply@anthropic.com>
Fix misspelling; callers updated to keep imports resolving. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
It's a list forwarded to Plot(renderers: list[...]); singular name was misleading. Co-Authored-By: Claude <noreply@anthropic.com>
save_dpi is Optional (compile passes args.save_dpi, default None). Co-Authored-By: Claude <noreply@anthropic.com>
because setting x_data or y_data separately was invalid when lengths differed between frames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a major change, and likely introduces some regressions.
Features
Overplotting
This is the motivating feature. Psc-plot can now plot multiple datasets at once, either in separate axes or overplotted. To do so, use$B_x(y)$ and $B_z(y)$ on the same axis:
--withand multiple--versus. For example, the following plots bothOverplotting with more than 2 images or any number of scatterplots and/or polar meshes is not yet supported.
Multiple Axes
A plot can be positioned within a figure by passing
loc=i,jto--versus. Per matplotlib custom, i and j are 1-indexed. The default is 1,1. For example, to stack two images vertically:The layout is still work-in-progress. Eventually, axes and labels will be shared when possible.
Multiple Loaders
It is possible to switch between prefixes using
--with. For example:Note that$E_y$ vertical scale.
--scaleabove applies to the particle color scale, but not theConstrained Layout
Figures use a "constrained" layout instead of a "tight" layout now, resulting in less whitespace padding.
Help Doesn't Require Data
psc-plot -hno longer complains about missing data dir if none is set.Internal Changes
Decoupled Field Data
This is actually an observable change. Field data is no longer stored as an
xr.Dataset. It's now a dict of keys toxr.DataArrays, which is basically what a Dataset is, but without any coupling of coordinates between the DataArrays.Data World
Adaptors now transform "data worlds", which is basically a dict of prefixes to data-metadata structs. (Before, they just transformed individual structs.) Loaders are thus technically adaptors now.
Plot Targets
A data world also has a list of "plot targets". These are set by
--versusand replaces some old metadata.Plot Infos
Renderers now transform plot targets and their associated data into "plot infos". Each plot info is hooked up to an actual matplotlib object via callbacks. Renderers simply update the plot infos at each frame; the callbacks handle updating the figure.