matplotlib / matplotlib/basemap

Ortho projection fails at south pole in pcolormesh

Open
#207 12 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
817
Forks
395
PR merge metrics
No merged PRs in 30d

Description

I am plotting gridded satellite data using basemap 1.0.7 (I can't get 1.0.8 via pip yet). The grid is 0.25 degrees resolution, global coverage.

For polar views, I use pcolormesh. It works fine for the north polar view:

```
bmap = Basemap(projection='ortho', lat_0=90, lon_0=270, resolution='c')
show_map = bmap.pcolormesh(lons, lats, darray, vmin=vminval, vmax=vmaxval,
norm=norm, cmap=this_cmap, alpha=1.0, latlon=True)
```

but the corresponding map centered on the south pole plots garbage:

```
bmap = Basemap(projection='ortho', lat_0=-90, lon_0=270, resolution='c')
show_map = bmap.pcolormesh(lons, lats, darray, vmin=vminval, vmax=vmaxval,
norm=norm, cmap=this_cmap, alpha=1.0, latlon=True)
```

However, pcolor plots correctly at the south pole. This one is fine:

```
bmap = Basemap(projection='ortho', lat_0=-90, lon_0=270, resolution='c')
show_map = bmap.pcolor(lons, lats, darray, vmin=vminval, vmax=vmaxval,
norm=norm, cmap=this_cmap, alpha=1.0, latlon=True)
```

In this case, my gridded data array is pretty small and the time difference between pcolormesh and pcolor is negligible, but I'm guessing this is something that ought to be fixed, unless it already has been addressed in 1.0.8.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the provided north- and south-pole Basemap examples using pcolormesh and pcolor, then inspect the Basemap pcolormesh implementation and its projection handling. The fix is complete when south-pole orthographic pcolormesh produces the same correct map as pcolor without regressing the north-pole case.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.