matplotlib / matplotlib/basemap
pcolormesh does not work with south pole ortho projection
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 817
- Forks
- 395
- PR merge metrics
- No merged PRs in 30d
Description
The north pole works fine when setting lat_0=90 but when setting lat_0=-90 it doesn't work. The data shown in the southern projection is nonsense.
Related to #347 and #350 but the workaround described there for the "stereo" projection does not work for the "ortho" projection.
Code to replicate:
```
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
lons = np.arange(-179.95, 180.01, 0.1)
lats = np.arange(-89.95, 90.01, 0.1)
# m = Basemap(projection='ortho', lon_0=-270, lat_0=-90., resolution='c')
m = Basemap(projection='ortho', lon_0=0, lat_0=90., resolution='c')
data = np.random.random((1800, 3600))
lons, lats = np.meshgrid(lons, lats)
x, y = m(lons, lats)
# data = np.ma.masked_where((x < m.xmin) | (x > m.xmax) | (y < m.ymin) | (y > m.ymax), data)
im = m.pcolormesh(x, y, data, latlon=False, cmap='RdBu')
m.colorbar(im)
m.drawcoastlines()
m.drawcountries()
plt.show()
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied Basemap ortho projection reproduction, comparing lat_0=90 with lat_0=-90 through the pcolormesh path. Review related issues #347 and #350, then verify that the southern projection displays the data correctly without breaking the existing northern projection behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, numpy, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100