Re: [Matplotlib-users] Meridians not show using Mercator projection
On 11/16/11 8:00 PM, Eric Firing wrote: On 11/16/2011 03:16 PM, Gökhan Sever wrote: Hi, Using the example code shown below I can't get meridians plotted on the screen: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np m = Basemap(projection='merc',lon_0=-79, lat_0=25.5, llcrnrlon=-93, urcrnrlon=-63, llcrnrlat=14, urcrnrlat=36.2) m.drawcoastlines(linewidth=0.3) parallels = np.arange(0.,90,2.) m.drawparallels(parallels, labels=[1,0,0,0]) meridians = np.arange(180.,360.,5.) It can't handle the wrap; subtract 360 from your meridians, and they will show up. I just committed a fix for this, so that the wraparound is handled automatically in drawmeridians. -Jeff Eric m.drawmeridians(meridians, labels=[0,0,0,1]) plt.show() Two other projections laea and tmerc work fine for this case. Any ideas? Thanks. -- Gökhan -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX: (303)497-6449 NOAA/OAR/PSD R/PSD1Email : jeffrey.s.whita...@noaa.gov 325 BroadwayOffice : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Meridians not show using Mercator projection
Thanks Jeff and Eric. Both solutions simply works :) -- Gökhan -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Meridians not show using Mercator projection
Hi, Using the example code shown below I can't get meridians plotted on the screen: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np m = Basemap(projection='merc',lon_0=-79, lat_0=25.5, llcrnrlon=-93, urcrnrlon=-63, llcrnrlat=14, urcrnrlat=36.2) m.drawcoastlines(linewidth=0.3) parallels = np.arange(0.,90,2.) m.drawparallels(parallels, labels=[1,0,0,0]) meridians = np.arange(180.,360.,5.) m.drawmeridians(meridians, labels=[0,0,0,1]) plt.show() Two other projections laea and tmerc work fine for this case. Any ideas? Thanks. -- Gökhan -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Meridians not show using Mercator projection
On 11/16/2011 03:16 PM, Gökhan Sever wrote: Hi, Using the example code shown below I can't get meridians plotted on the screen: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np m = Basemap(projection='merc',lon_0=-79, lat_0=25.5, llcrnrlon=-93, urcrnrlon=-63, llcrnrlat=14, urcrnrlat=36.2) m.drawcoastlines(linewidth=0.3) parallels = np.arange(0.,90,2.) m.drawparallels(parallels, labels=[1,0,0,0]) meridians = np.arange(180.,360.,5.) It can't handle the wrap; subtract 360 from your meridians, and they will show up. Eric m.drawmeridians(meridians, labels=[0,0,0,1]) plt.show() Two other projections laea and tmerc work fine for this case. Any ideas? Thanks. -- Gökhan -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Meridians not show using Mercator projection
On 11/16/11 6:16 PM, Gökhan Sever wrote: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np m = Basemap(projection='merc',lon_0=-79, lat_0=25.5, llcrnrlon=-93, urcrnrlon=-63, llcrnrlat=14, urcrnrlat=36.2) m.drawcoastlines(linewidth=0.3) parallels = np.arange(0.,90,2.) m.drawparallels(parallels, labels=[1,0,0,0]) meridians = np.arange(180.,360.,5.) m.drawmeridians(meridians, labels=[0,0,0,1]) plt.show() Two other projections laea and tmerc work fine for this case. Any ideas? Thanks. -- Gökhan Gökhan: The longitudes in your projection definition are negative (-93 to -63), so you need to change meridians = np.arange(180.,360.,5.) to meridians = np.arange(-180.,0.,5.) It works for the other projections, since the values get transformed to projection coordinates anyway. With merc and cyl, there is no transformation for longitudes. -Jeff -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users