Conversation
aidanheerdegen
left a comment
There was a problem hiding this comment.
If you're converting to xarray it is best to use the xarray plot methods, which will fix the issue in cell 7.
So this works:
ds.plot.quiver(x='lon', y='lat', u='wind_u', v='wind_v',
pivot='mid', transform=ccrs.PlateCarree())In general the xarray plot methods add so much that their use should be encouraged.
I know there are many many ways to do the same action in matplotlib, but personally I think it is confusing calling plt.subplots when there is only one plot.
fig, ax = plt.subplots(figsize=(16, 8),
subplot_kw={'projection': ccrs.PlateCarree(central_longitude=180)}
)This is the formulation I typically see used and think it is clearer what is being done:
plt.figure(figsize=(16, 8))
ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=180))but that is up to your discretion clearly.
With the last example I think you should note in the text that arrows are automatically scaled, but in this case you have manually altered the scale, and how that works (counterintuitively it seems). Also you've set the width, might be worth mentioning why you did this, and what the default value is (maybe that is installation dependent?, not sure).
|
|
|
Still worth putting it up IMO, highlighting the new functionality. |
Adding a new blog post about quiver and cartopy