|
36 | 36 | x, y = map(lons*180./np.pi, lats*180./np.pi) |
37 | 37 | # contour data over the map. |
38 | 38 | cs = map.contour(x,y,wave+mean,15,linewidths=1.5) |
| 39 | +plt.title('filled continent background') |
| 40 | + |
| 41 | +# as above, but use land-sea mask image as map background. |
| 42 | +fig = plt.figure() |
| 43 | +map.drawmapboundary() |
| 44 | +map.drawmeridians(np.arange(0,360,30)) |
| 45 | +map.drawparallels(np.arange(-90,90,30)) |
| 46 | +# plot filled circles at the locations of the cities. |
| 47 | +map.plot(xc,yc,'wo') |
| 48 | +# plot the names of five cities. |
| 49 | +for name,xpt,ypt in zip(cities,xc,yc): |
| 50 | + plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w') |
| 51 | +# contour data over the map. |
| 52 | +cs = map.contour(x,y,wave+mean,15,linewidths=1.5) |
| 53 | +plt.title('land-sea mask background') |
| 54 | +map.drawlsmask(ocean_color='aqua',land_color='coral') |
39 | 55 |
|
40 | 56 | # as above, but use blue marble image as map background. |
41 | 57 | fig = plt.figure() |
|
49 | 65 | plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w') |
50 | 66 | # contour data over the map. |
51 | 67 | cs = map.contour(x,y,wave+mean,15,linewidths=1.5) |
52 | | -# draw shaded relief image in background. |
| 68 | +plt.title('blue marble background') |
| 69 | +map.bluemarble() |
| 70 | + |
| 71 | +# as above, but use shaded relief image as map background. |
| 72 | +fig = plt.figure() |
| 73 | +map.drawmapboundary() |
| 74 | +map.drawmeridians(np.arange(0,360,30)) |
| 75 | +map.drawparallels(np.arange(-90,90,30)) |
| 76 | +# plot filled circles at the locations of the cities. |
| 77 | +map.plot(xc,yc,'wo') |
| 78 | +# plot the names of five cities. |
| 79 | +for name,xpt,ypt in zip(cities,xc,yc): |
| 80 | + plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w') |
| 81 | +# contour data over the map. |
| 82 | +cs = map.contour(x,y,wave+mean,15,linewidths=1.5) |
| 83 | +plt.title('shaded relief background') |
53 | 84 | map.shadedrelief() |
| 85 | + |
| 86 | +# as above, but use etopo image as map background. |
| 87 | +fig = plt.figure() |
| 88 | +map.drawmapboundary() |
| 89 | +map.drawmeridians(np.arange(0,360,30)) |
| 90 | +map.drawparallels(np.arange(-90,90,30)) |
| 91 | +# plot filled circles at the locations of the cities. |
| 92 | +map.plot(xc,yc,'wo') |
| 93 | +# plot the names of five cities. |
| 94 | +for name,xpt,ypt in zip(cities,xc,yc): |
| 95 | + plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w') |
| 96 | +# contour data over the map. |
| 97 | +cs = map.contour(x,y,wave+mean,15,linewidths=1.5) |
| 98 | +plt.title('etopo background') |
| 99 | +map.etopo() |
| 100 | + |
54 | 101 | plt.show() |
0 commit comments