Broken Basemap rotpole projection
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- data-visualization
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.
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.
# 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
- Dominant language
- Python
- Stars
- 817
- Forks
- 395
- PR merge metrics
- No merged PRs in 30d
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.
More from matplotlib/basemap
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
matplotlib/basemap#368 ·
-
Python 3.14 wheels Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
matplotlib/basemap#652 · 2 comments · 5 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
matplotlib/basemap#649 · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
matplotlib/basemap#646 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
matplotlib/basemap#645 · 2 comments ·
All issues in matplotlib/basemap
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100