python - Basemap error: module object is not callable -


i trying learn how use basemap in python. used following site learning http://www.datadependence.com/2016/06/creating-map-visualisations-in-python/. when typed following

import matplotlib.pyplot plt import matplotlib.cm import basemap fig,ax=plt.subplots(figsize=(10,20)) m=basemap(resolution='c',projection='merc',lat_0=54.5,lon_0=-4.36,llcrnrlon=-6.,llcrnrlat=49.5,urcrnrlon=2.,urcrnrlat=55.2) m.drawmapboundary(fill_color='#46bcec') m.fillcontinents(color='#f2f2f2',lake_color='#46bcec') m.drawcoastlines() 

i error typeerror: 'module' object not callable. why reason this?

you misunderstood example code. have write:

from mpl_toolkits.basemap import basemap m=basemap(resolution='c',projection='merc',lat_0=54.5,lon_0=-4.36,llcrnrlon=-6.,llcrnrlat=49.5,urcrnrlon=2.,urcrnrlat=55.2) 

basemap have start capital letter. important python. python case sensitivity language.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -