Skip to content

wrapping of longitude #54

@petrushy

Description

@petrushy

I am trying to scatter plot on maps with nonzero middle longitude, but the areas where the map is "wrapped" are not plotted.

My test script:


from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

m = Basemap(lon_0=160)
m.fillcontinents()

for x in range(-179, 179):
px1, py1 = m(x, x/4.0)
m.scatter(px1,py1, zorder=3)

plt.show()


If lon_0 is zero it works fine but with non-zero lat_0 some areas are not plotted.

It seems like the m(lon,lat) is not wrapping the points, the points I expect to wrap are negative in px1?

Or am I missing some transformation step?

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