-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
After some time I worked out how to create a scatter plot onto of a satpy/cartopy plot.
I know i'm not the first person who has come across this as it has been brought up before (https://pytroll.slack.com/archives/C06GJFRN0/p1588754633277200).
The cartopy plot notebook https://github.com/pytroll/pytroll-examples/blob/master/satpy/Cartopy%20Plot.ipynb could have an extra cell demonstrating the use of crs
and ccrs.PlateCarree()
For example here's a cartopy plot with a scatter plot using the hurricane Florence example:
from satpy import Scene, demo
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
filenames = demo.get_hurricane_florence_abi(num_frames=1)
scn = Scene(reader='abi_l1b', filenames=filenames)
scn.load(['C01'])
new_scn = scn.resample(scn['C01'].attrs['area'])
crs = new_scn['C01'].attrs['area'].to_cartopy_crs()
ax = plt.axes(projection=crs)
ax.coastlines()
ax.gridlines(draw_labels=True)
ax.set_global()
plt.imshow(new_scn['C01'], transform=crs, extent=crs.bounds, origin='upper')
ax.scatter(-65, 27, marker='o', transform=ccrs.PlateCarree(), color='red', s=50)
plt.show()
Metadata
Metadata
Assignees
Labels
No labels