The first two lines into the corresponding library, the real code is 4 lines, simple enough. The 1th line may not even be written, it defines the size of the graph. Line 2nd we create a map, line 3rd lines up the shoreline, and the 4th line shows the map, that's it:
You use Java
the 4
line code to draw a map out?
And then we started painting the country, and again, 1 lines of code:
m.drawcountries(linewidth=1.5)
It becomes this:
Looks a bit deformed, this is because we did not add any projection of the reason, Basemap
provide a 24
different projection method, you can try it one after another, more commonly 兰勃特投影
, we add:
m = Basemap(llcrnrlon=77, llcrnrlat=14, urcrnrlon=140, urcrnrlat=51, projection=‘lcc‘, lat_1=33, lat_2=45, lon_0=100)
This time it looks more normal at last:
God-level programmers teach you how to draw a map of China with four lines of code! Python is a cool thing.