matplotlib / matplotlib/basemap
Broken Basemap rotpole projection
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 817
- Forks
- 395
- PR merge metrics
- No merged PRs in 30d
Description
Initally posted by a mistake to matplotlib/matplotlib
https://github.com/matplotlib/matplotlib/issues/9541
Here seems to be more relevant..
### Bug report
**Bug summary**
Basemap can't plot rotated-pole maps that cross rotated-grid's 0-th meridian
**Code for reproduction**
Here is a simple code that produce two maps for non-rotated grid (zero-rotation).
One does not cross Greenwich meridian another one does.
```python
# Paste your code here
#
#
#!/usr/bin/python
import matplotlib as mpl
mpl.use('AGG')
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.basemap import Basemap
import os
figname="okay.png"
fig = plt.figure()
bmap = Basemap(projection='rotpole',
llcrnrx=0, urcrnry=15,
urcrnrx=25, llcrnry=-15,
lon_0 = 0,
o_lon_p = 0.,
o_lat_p = 90.,
resolution='c')
bmap.drawmapboundary(fill_color='aqua')
bmap.fillcontinents(color='coral',lake_color='aqua')
bmap.drawcoastlines(linewidth=0.5)
bmap.drawparallels(np.arange(-20,20,10.))
bmap.drawmeridians(np.arange(-40,40,10.))
mpl.pyplot.savefig(figname)
figname="broken.png"
fig.clf()
bmap = Basemap(projection='rotpole',
llcrnrx=-25, urcrnry=15,
urcrnrx=25, llcrnry=-15,
lon_0 = 0,
o_lon_p = 0.,
o_lat_p = 90.,
resolution='c')
bmap.drawmapboundary(fill_color='aqua')
bmap.fillcontinents(color='coral',lake_color='aqua')
bmap.drawcoastlines(linewidth=0.5)
bmap.drawparallels(np.arange(-20,20,10.))
bmap.drawmeridians(np.arange(-40,40,10.))
mpl.pyplot.savefig(figname)
```
**Actual outcome**
Here are two maps.. The second one is obviously broken.


**Matplotlib version**
* Operating system: Python 2.7.1, python-matplotlib 1.5.1-1ubuntu1
* Matplotlib version: 1.5.1-1ubuntu1
* Python version: 2.7.1
Default Ubuntu 16.04.3 LTS installation
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 by running the provided reproduction script and comparing the two generated maps. Trace Basemap's rotpole projection handling for bounds crossing the rotated grid's zero meridian; done means both cases render map boundaries, coastlines, continents, parallels, and meridians correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100