Skip to content

Plotting with extra dimensions #1600

Open

Description

@Sevans711

Proposed new feature or change:

Right now, uxarray plotting routines crash if the underlying data includes any dimensions not connected to the grid. For example:

import uxarray as ux
data = ux.tutorial.open_dataset("outCSne30-timeseries")
print(data['psi'].sizes)    # {'time': 6, 'n_face': 5400}
data['psi'].plot()

Makes: ValueError: Data Variable must be 1-dimensional, with shape 5400 for face-centered data.

Proposed features:

  1. Provide options to create animations/movies in time (or any other non-grid dimension).
  2. Provide options add a slider or dropdown menu to slide/click through non-grid dimensions, like time or elevation, at least when using "bokeh" backend.
  3. For small-sized extra dimensions (size<10, ish?), make it easy to create multiple plots; for example, in this case, maybe it should be easy to make 6 subplots, showing the values at each time.
  4. Allow plotting datasets with small (<10, ish) number of data_vars; e.g. making one subplot per var (equivalent to (3) above, using uxds.to_array().plot() with dim="variable" as the "small-sized extra dimension") or allowing an animation, slider, or dropdown (as in suggestions (1) and (2) above).
  5. Avoid accidentally plotting way too much at once, by imposing (adjustable) default limits on sizes, raising error if inputs are too large. Example: "ValueError: refused to plot row='time' with 50 subplots; can adjust maximum number of plots per row via subplots_row_size_max=value (default: 10)"

Should these options occur by default, or require using flags, such as data['psi'].plot(row='time')? If they require using flags, then the default error message should be improved, to help users find those flags.

Sidenote: maybe the default error message could also be improved in the meantime by printing the sizes actually found in the data? Something like: ValueError(f"plotting only supports 1-dimensional data variable; expected face-centered array with n_faces=5400; got {array.data_location} array with sizes {array.sizes}") would have helped me understand the error and how to debug it much faster.

Activity

  1. added
    new feature
    visualization
    on Jul 21, 2026
  2. added
    extra dims
    on Aug 11, 2026
  3. moved this from 📚 Backlog to On Pause in UXarray Developmenton Aug 20, 2026
  4. Sevans711 commented on Aug 20, 2026

    @Sevans711
    CollaboratorAuthor

    Report-back from discussion about this: sounds like there is definitely a desire to support plotting with multiple dimensions. However, it remains unclear whether the best way forwards would be to add new functionality directly into the uxarray API, or to keep it out of the API but instead focus on providing more detailed multidimensional plotting examples in the documentation. Probably should take some time to explore different options and discuss further before implementing changes directly to uxarray.

    @erogluorhan expressed interest in maybe having people look into whether https://github.com/github/spec-kit could help with developing a GUI for making multidimensional plot visualizations, or with developing any of these features in general.

    Sidenote from me: if I recall correctly, the processing time for holoviews to build an animation or multidimensional interactive plot is likely to be much faster than saving all frames independently then joining into an animation via pillow or ffmpeg. This means using holoviews directly to build movies may provide a huge speedup. I haven't yet looked into how well this scales to larger datasets, though.

  5. rajeeja commented on Aug 25, 2026

    @rajeeja
    Contributor

    Chiming in on the GUI question, mostly from watching how people in this space actually work:

    • A lot of users know exactly which slice they want before they open anything. One time step, one level, static PNG, done — animation and interactivity aren't features they'd use, and I don't think we should assume everyone wants a movie.
    • For the users who do want interactive exploration, VisIt and ParaView are already the tools they reach for, and they're a long way ahead of anything we'd build. Making sure our data lands cleanly in those probably buys more than a viewer of our own.
    • I hit this exact error building tooling on uxarray — multi-level, multi-time E3SM output tripping the 1-dimensional check. Per-dimension index selection plus reporting back which slice got taken was enough; I never needed animation to get the science done.
    • Yes to the better error message and the size guard (item 5) now since they help everyone, holoviews animation as a documented example, and GUI as a separate exploration rather than a uxarray feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extra dimsnew featurevisualization

    Type

    No type

    Fields

    Priority

    Medium

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions