mik
mik

Reputation: 110

basemap returns blank when plotting points

I'm new to basemap and map plots in general. After looking through documentation online, I was able to install basemap and GEOS no problem. I was able to setup my basemap map with the following code:

themap = Basemap(projection='gall',
                resolution='i',
                llcrnrlon = -135,              
                llcrnrlat = 23,               
                urcrnrlon = -60,               
                urcrnrlat = 50,              
                )
themap.drawcoastlines()
themap.drawcountries()
themap.drawstates()
themap.fillcontinents(color = 'gainsboro')
themap.drawmapboundary(fill_color='light blue')

This works fine and I get the map of the US exactly as I wanted:

map of the US

Now I want to overlay my data. As a test, i'll just try to plot one random point with this code:

x,y = themap(37, -95)
themap.plot(x,y,'ko')
plt.show()

nada

I get nothing but a blank canvas. Even my original map doesn't render now. There are no error messages, warnings or anything. So I don't know whats going wrong. I've run a lot of the examples from the examples directory of my basemap directory, and they all work fine. So i'm confused as to why i can't get this plot to show. Am I doing something obviously stupid?

Upvotes: 0

Views: 674

Answers (1)

J Kelly
J Kelly

Reputation: 510

The order of the points should be (lon, lat). This is working for me:

enter image description here

Upvotes: 1

Related Questions