Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mollweide projection centered in eastern hemisphere reverses X axis #443

Closed
d-chambers opened this issue Nov 25, 2018 · 5 comments
Closed

Comments

@d-chambers
Copy link

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:

image

@d-chambers d-chambers changed the title Moll projection centered in eastern hemisphere reverses X axis Mollweide projection centered in eastern hemisphere reverses X axis Nov 25, 2018
@WeatherGod
Copy link
Member

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?)

@ocefpaf
Copy link
Contributor

ocefpaf commented Nov 26, 2018

I can confirm that this happens with latest proj4 5.2.0 but not with proj4 4.9.3.

@d-chambers
Copy link
Author

Yes installed with Anaconda.

pyproj: '1.9.5.1'
proj4: '5.2.0'

@megies
Copy link
Contributor

megies commented May 22, 2019

@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?

@molinav
Copy link
Member

molinav commented Nov 21, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants