You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Help with weird uxarray, matplotlib, and orthographic plot #1489
Today I was trying out different things with uxarray and some data and found an...oddity. With the bokeh backend, I get a nice pretty image with an Orthographic projection:
but when I try and use the matplotlib backend:
Does anyone know what I might be doing wrong? My "relevant" code is:
Just the backend change in ortho_plot is the differences between these two. Note: This is a mix of uxarray examples and Gemini/ChatGPT/whatever so I freely admit I probably did something stupid!
The problem seems related to gv.Feature(graticules, group="Lines") using the Natural Earth graticules_15 feature. The base UXarray polygon plot, gf.coastline(), and gf.borders() all render correctly with the matplotlib backend but adding the graticules feature causes the rendering to collapse.
As a workaround, I was able to get the expected result by avoiding gv.Feature(graticules_15) and instead adding gridlines directly through the Cartopy axis using ax.gridlines(...) after rendering:
This suggests the issue may be somewhere in the GeoViews/Cartopy feature overlay or clipping pipeline rather than in UXarray itself. Hopefully this helps @mathomp4 :)
Confirming, this looks like an upstream issue, I was able to reproduce it without using UXarray at all. See holoviz/geoviews#845 for more details!
Thanks for pointing this out. It seems like our fix still holds
So, are you suggesting that we should still put together a workaround, maybe something close to what @alioacar suggested? I think I lean more towards waiting for the fix on the holoviz/geoviews/issues/845.
I misspoke — I was thinking of #1515 which fixed Bokeh Orthographic plots, but that's unrelated. The matplotlib+graticules issue is purely upstream in geoviews (holoviz/geoviews#845). Agree with you: wait for holoviz/geoviews#846 to merge.
Activity
mathomp4 commentedon Apr 13, 2026
@erogluorhan Here is a link to the file
It's pretty small to make things easy.
mathomp4 commentedon Apr 13, 2026
Whoops. I also forgot one sort of crucial thing in the Python snippet:
I mean, you need to open the file 😄
alioacar commentedon May 15, 2026
The problem seems related to
gv.Feature(graticules, group="Lines")using the Natural Earthgraticules_15feature. The base UXarray polygon plot, gf.coastline(), and gf.borders() all render correctly with the matplotlib backend but adding the graticules feature causes the rendering to collapse.As a workaround, I was able to get the expected result by avoiding
gv.Feature(graticules_15)and instead adding gridlines directly through the Cartopy axis usingax.gridlines(...)after rendering:This suggests the issue may be somewhere in the GeoViews/Cartopy feature overlay or clipping pipeline rather than in UXarray itself. Hopefully this helps @mathomp4 :)
erogluorhan commentedon May 18, 2026
@alioacar thanks a lot for looking into this and suggesting a workaround! I'll try to think about this case a bit more when I have some time.
Sevans711 commentedon Jun 29, 2026
Confirming, this looks like an upstream issue, I was able to reproduce it without using UXarray at all. See holoviz/geoviews#845 for more details!
rajeeja commentedon Jun 30, 2026
Thanks for pointing this out. It seems like our fix still holds
erogluorhan commentedon Jun 30, 2026
So, are you suggesting that we should still put together a workaround, maybe something close to what @alioacar suggested? I think I lean more towards waiting for the fix on the holoviz/geoviews/issues/845.
alioacar commentedon Jul 1, 2026
I initially thought this was a more complex overlay issue. @erogluorhan I agree that it's better waiting for the fix to be merged
rajeeja commentedon Jul 1, 2026
I misspoke — I was thinking of #1515 which fixed Bokeh Orthographic plots, but that's unrelated. The matplotlib+graticules issue is purely upstream in geoviews (holoviz/geoviews#845). Agree with you: wait for holoviz/geoviews#846 to merge.
erogluorhan commentedon Jul 1, 2026
Okay, perfect, thanks for clarifying @rajeeja and @alioacar !
Let's keep this open until the geoviews fix is released, and then we can give this a second try and hopefully close it once confirmed things work.
erogluorhan commentedon Sep 2, 2026
Test it again once geoviews 1.15.2 is released and close if it looks good.
mathomp4 commentedon Sep 3, 2026
Will do! Hopefully it is released soon :)
erogluorhan commentedon Oct 27, 2026
@mathomp4 , geoviews 1.15.2 is now released and we closed this. Please feel free to reopen if you test it and think it is not resolved.
mathomp4 commentedon Nov 3, 2026
@erogluorhan Sorry it took me so long, but I can see things are now good with geoviews 1.16.0. Thanks!
erogluorhan commentedon Nov 3, 2026
No worries at all; thanks for confirming it works! Best,