Skip to content

Overlaying Contours on Color-Filled Shading in UXarray/Holoviews/Matplotlib #1243

Closed

Description

@philipc2

Discussed in #1193

Originally posted by falkojudt March 27, 2025
Is there a way to overlay contours on a color-filled shading, similar to this example where the background represents wind speed and the black contours indicate sea level pressure?

Wulfmeyer_XXL_WRF_Fig03

Activity

  1. moved this from 📚 Backlog to 📝 To-Do in UXarray Developmenton May 7, 2025
  2. added this to the SIParCS 2025 milestone on May 7, 2025
  3. moved this from 📝 To-Do to 👀 In review in UXarray Developmenton Aug 5, 2025
  4. moved this from 👀 In review to 📝 To-Do in UXarray Developmenton Aug 5, 2026
  5. added
    new feature
    visualization
    on Aug 5, 2026
  6. dylannelson commented on Sep 23, 2026

    @dylannelson
    Member

    Certainly seems possible using only UXarray and it's dependencies (matplotlib/cartopy/numpy/xarray)
    Here's a few demos:

    One made with matplotlib and smooth contour

    Image

    One made with holoviews

    Image

    Another with matplotlib and rougher contours

    Image

    Contour Methods

    When looking at the contours, there's a few routes availible

    Method Input to matplotlib
    a ax.tricontour on face centres 1-D face values + Delaunay triangulation of the centres
    b remap.to_rectilinear then ax.contour 2-D lon/lat array (nearest-neighbour remap)
    c to_raster then ax.contour the 2-D pixel raster already used for shading
    Image

    Notebook

    To reproduce any of this, here's a trimmed down of the code in a notebook here:

    04-contour-overlay-minimal.html

  7. erogluorhan commented on Sep 25, 2026

    @erogluorhan
    Member

    @dylannelson , thanks for looking into this!

    I think we should do a number of things here:

    • For our plotting API, i.e. holoviz, implement a plot.contour() function as suggested here in Support for contour plots #366
      • It can be a starting point only, and we can improve throughout
    • Clean up and publish your notebook under our examples, and have two sections in it in regards to how to do contours with uxarray, uxarray's plot API and matplot

    Does this all make sense to you?

  8. dylannelson commented on Sep 25, 2026

    @dylannelson
    Member

    @erogluorhan When you say 2 different sections, are you saying one that is a demo of rasters that is primarily uxarray, and another full demo that is primarily matplotlib, or something else? If so, are there certain aspects you certainly want to be in either example? like specific functions within uxarray, workflows, types of filtering, etc? We mentioned this could be a good demo for a few different cases/audiences, so I'm happy to make include other types of highlights here as well, if it's wanted, or we can keep it more focused on the visualization creation and modification.

  9. moved this from 🏗 In progress to 👀 In review in UXarray Developmenton Oct 21, 2026
  10. moved this from 👀 In review to ✅ Done in UXarray Developmenton Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

new featurevisualization

Type

No type

Fields

Priority

None yet

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions