Skip to content

Mollweide projection centered in eastern hemisphere reverses X axis #443

Closed

Description

@d-chambers

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

Activity

  1. changed the title [-]Moll projection centered in eastern hemisphere reverses X axis[/-] [+]Mollweide projection centered in eastern hemisphere reverses X axis[/+] on Nov 25, 2018
  2. WeatherGod commented on Nov 26, 2018

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

  3. ocefpaf commented on Nov 26, 2018

    @ocefpaf
    Contributor

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

  4. d-chambers commented on Nov 27, 2018

    @d-chambers
    Author

    Yes installed with Anaconda.

    pyproj: '1.9.5.1'
    proj4: '5.2.0'

  5. megies commented on May 22, 2019

    @megies
    Contributor

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

  6. molinav commented on Nov 21, 2023

    @molinav
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions