Skip to content

.plot() method for Grid Object  #118

Closed

Description

@philipc2

Similar to Xarray, directly allow for plotting from a Grid Object (compared to a DataArray).

Proposed Functionality

  • Calling .plot() on a Grid object with no data variables (only grid info) would render an unfilled mesh
  • Calling .plot() on a Grid object with an argument for data variables, indexing, etc, would render a filled mesh according to the user inputs

PolyMesh Specific

  • Goal is to incorporate my PolyMesh code to handle visualizations, however due to package dependencies starting off with SciPy's or MPL's triangulation might be better (having both options would be good too)
  • Any mesh that's constructed during plotting would be stored in the Grid object to reduce computation time on repeated plots (ex. plotting multiple data variables on the same mesh)

Activity

  1. added
    new feature
    on Sep 6, 2022
  2. self-assigned this
    on Sep 6, 2022
  3. philipc2 commented on Sep 13, 2022

    @philipc2
    MemberAuthor

    @dcherian @rajeeja @paullric @erogluorhan

    Any comments or suggestions? I think it might be worth discussing this topic during one of our bi-weekly meetings since there is a lot of design decisions we need to make before we can start working on it.

  4. rajeeja commented on Oct 5, 2022

    @rajeeja
    Contributor

    @dcherian @rajeeja @paullric @erogluorhan

    Any comments or suggestions? I think it might be worth discussing this topic during one of our bi-weekly meetings since there is a lot of design decisions we need to make before we can start working on it.

    What are the dependencies of PolyMesh? Is setting this up with SciPy or MPL's triangulation easy? IMO MPL has been the most reliable over the years.

  5. philipc2 commented on Oct 5, 2022

    @philipc2
    MemberAuthor

    @rajeeja

    PolyMesh is written around Datashader, with the main dependencies being Shapely (since PyGEOS merged with Shapely), Spatial Pandas, and GeoViews. Shapely2.0 is currently in an alpha release, and is still merging a lot of the PyGEOS work as we speak.

    Starting off with triangulation support using one of the SciPY or MPL methods would be a good start. We wouldn't be able to visualize large grids very efficiently, however it would be very easy to implement once we settle on a design.

  6. zarzycki commented on Oct 8, 2022

    @zarzycki
    Contributor

    This sounds most excellent @philipc2.

    I keep coming back to the comments in #46 (comment) ... I think it's important for any unstructured viz to reflect (or at least have a boolean switch) to reflect the underlying mesh and cell topology.

    So for the latter (Calling .plot() on a Grid object with an argument for data variables), I would consider that a relatively desirable feature that such contour maps properly show the underlying mesh.

    A potentially relevant example @cdeciampa shared with me this AM is: https://psyplot.github.io/examples/maps/example_ugrid.html

    Note https://psyplot.github.io/examples/_images/maps_example_ugrid_18_0.png, where the cells with more than 3 edges are correctly filled as one scalar value (it's possible the quads are really just two triangles glued together, I haven't dug deep enough into the source).

    One of the benefits of having a full grid description (i.e., having cell edges and vertices versus just lat/lon points) means viz tools using the description can be faithful to the computational mesh!

  7. added this to the Visualization milestone on Sep 12, 2023
  8. moved this from 📚 Backlog to 📝 To-Do in UXarray Developmenton Sep 18, 2023
  9. moved this from 📝 To-Do to 🏗 In progress in UXarray Developmenton Sep 19, 2023
  10. moved this from 🏗 In progress to ✅ Done in UXarray Developmenton Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

new feature

Type

No type

Fields

Priority

None yet

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions