Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature requestion: add example of scatter plot to Cartopy Plot.ipynb #34

Open
raybellwaves opened this issue Aug 9, 2020 · 0 comments

Comments

@raybellwaves
Copy link

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()

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant