Hi,

I may have found an issue with some map projections.When I try to plot
markers on a given map, and change the center ofprojection, the
markers' coordinates are not remapped correctly.If the marker's
coordinates are not inside the new boundaries, it issimply not
displayed in some cases.For example, remapping does work with Robin's
projection and does notwith Miller's.I have attached a small example.
Thanks !


Alexis Praga
import numpy as np
import sys 
import matplotlib.pyplot as p
from mpl_toolkits.basemap import Basemap

nb_lat = 2
nb_lon = 360
nb_lines = nb_lat*nb_lon
lat = np.zeros(nb_lines,float)
lon = np.zeros(nb_lines,float)
data = np.zeros(nb_lines,float)
k = 0
for i in range(nb_lat):
  for j in range(nb_lon):
    lat[k] = i
    lon[k] = j-180
    data[k] = i+j
    k = k + 1

## This works
#map = Basemap(projection='robin',lon_0=180,resolution='c')
# Not this
map = Basemap(projection='mill',llcrnrlat=-90,urcrnrlat=90,llcrnrlon=0,urcrnrlon=360,resolution='c')
map.drawcoastlines()
map.drawmapboundary()

x,y = map(lon,lat)
map.scatter(x,y, s=10, c=data, marker='o',edgecolors='none')

p.savefig('dataset.jpg')
------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to