Skip to content

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

@raybellwaves

Description

@raybellwaves

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions