Skip to content

Commit acd2ea2

Browse files
committed
Fix transform in 7.6 (by @chrrrisw)
1 parent d9fc605 commit acd2ea2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

chapter07_stats/06_kde.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@
110110
"source": [
111111
"# We use a simple equirectangular projection,\n",
112112
"# also called Plate Carree.\n",
113+
"geo = ccrs.Geodetic()\n",
113114
"crs = ccrs.PlateCarree()\n",
114115
"# We create the map plot.\n",
115116
"ax = plt.axes(projection=crs)\n",
116117
"# We display the world map picture.\n",
117118
"ax.stock_img()\n",
118119
"# 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)"
120121
]
121122
},
122123
{
@@ -136,8 +137,7 @@
136137
}
137138
],
138139
"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",
141141
"h.shape"
142142
]
143143
},
@@ -164,7 +164,7 @@
164164
" np.linspace(y0, y1, k))\n",
165165
"# We reshape the grid for the kde() function.\n",
166166
"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",
168168
"v = kde(mesh).reshape((k, 2 * k))"
169169
]
170170
},

0 commit comments

Comments
 (0)