|
110 | 110 | "source": [ |
111 | 111 | "# We use a simple equirectangular projection,\n", |
112 | 112 | "# also called Plate Carree.\n", |
| 113 | + "geo = ccrs.Geodetic()\n", |
113 | 114 | "crs = ccrs.PlateCarree()\n", |
114 | 115 | "# We create the map plot.\n", |
115 | 116 | "ax = plt.axes(projection=crs)\n", |
116 | 117 | "# We display the world map picture.\n", |
117 | 118 | "ax.stock_img()\n", |
118 | 119 | "# We display the storm locations.\n", |
119 | | - "ax.scatter(x, y, color='r', s=.5, alpha=.25)" |
| 120 | + "ax.scatter(x, y, color='r', s=.5, alpha=.25, transform=geo)" |
120 | 121 | ] |
121 | 122 | }, |
122 | 123 | { |
|
136 | 137 | } |
137 | 138 | ], |
138 | 139 | "source": [ |
139 | | - "geo = ccrs.Geodetic()\n", |
140 | | - "h = geo.transform_points(crs, x, y)[:, :2].T\n", |
| 140 | + "h = crs.transform_points(geo, x, y)[:, :2].T\n", |
141 | 141 | "h.shape" |
142 | 142 | ] |
143 | 143 | }, |
|
164 | 164 | " np.linspace(y0, y1, k))\n", |
165 | 165 | "# We reshape the grid for the kde() function.\n", |
166 | 166 | "mesh = np.vstack((tx.ravel(), ty.ravel()))\n", |
167 | | - "# We evaluate the kde() functionon the grid.\n", |
| 167 | + "# We evaluate the kde() function on the grid.\n", |
168 | 168 | "v = kde(mesh).reshape((k, 2 * k))" |
169 | 169 | ] |
170 | 170 | }, |
|
0 commit comments