Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

basemap: How to remove actual lat/lon lines while keeping the ticks on the axis

I plotted a map by basemap as below:

plt.figure(figsize=(7,6))
m = Basemap(projection='cyl',llcrnrlat=40.125,urcrnrlat=44.625,\
        llcrnrlon=-71.875,urcrnrlon=-66.375,resolution='h')
m.drawparallels(np.arange(int(40.125),int(44.625),1),labels=[1,0,0,0])
m.drawmeridians(np.arange(int(-71.875),int(-66.375),1),labels=[0,0,0,1])
m.drawcoastlines()
m.fillcontinents(color='grey')
m.drawmapboundary()

The picture as below: enter image description here

How can I remove actual lat/lon lines while keeping the ticks on the axis?

like image 632
wuwucat Avatar asked Aug 21 '13 17:08

wuwucat


1 Answers

This can be easily achieved by setting the linewidth parameter to zero

m.drawparallels(np.arange(int(40.125),int(44.625),1),labels=[1,0,0,0], linewidth=0.0)
m.drawmeridians(np.arange(int(-71.875),int(-66.375),1),labels=[0,0,0,1], linewidth=0.0)

enter image description here

like image 64
Greg Avatar answered Sep 21 '22 18:09

Greg