basemap
basemap copied to clipboard
Mollweide projection centered in eastern hemisphere reverses X axis
When creating a Mollweide projection map with a positive lon_0 the x axis of the plot reverses.
I am using basemap version 1.1.0, matplotlib version 3.0.2, python 3.6, and Ubuntu 18.04.
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.basemap import Basemap
lons = [ 20, 20]
lats = [ 40, 20]
map = Basemap(projection='moll', resolution='l',
lon_0=np.mean(lons))
map.drawcoastlines(color='0.4')
map.drawcountries(color="0.75")
map.fillcontinents(color='coral',lake_color='aqua')
map.drawcoastlines()
x, y = map(lons, lats)
map.scatter(x, y, marker='D',color='m')
plt.show()
The code above produces this image:

wow... that's uhm... special. Not exactly sure how that is happening. What is your version of pyproj and the proj4 library (hopefully installed via conda?)
I can confirm that this happens with latest proj4 5.2.0 but not with proj4 4.9.3.
Yes installed with Anaconda.
pyproj: '1.9.5.1' proj4: '5.2.0'
@d-chambers I wanted to see if proj4 v6 fixes the problem but now I can't reproduce it anymore. Would you mind checking if we can use proj4 v6 safely?
A fix was provided by @YilongWang for issue #463, which is essentially a duplicate this issue. Since the fix is included in the upcoming hotfix release 1.3.9, I will close this issue.