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

Update cartopy training unit #103

Open
dopplershift opened this issue May 5, 2020 · 0 comments
Open

Update cartopy training unit #103

dopplershift opened this issue May 5, 2020 · 0 comments

Comments

@dopplershift
Copy link
Member

I put this together to answer a question:

import cartopy.crs as ccrs
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=ccrs.LambertConformal())

# Rectangle in projection coordinates
rect_proj = plt.Rectangle([-500000, -500000], width=800000, height=800000,
                          facecolor='none', edgecolor='tab:blue')
ax.add_artist(rect_proj)

# Rectangle in lon/lat coordinates
rect_geo = plt.Rectangle([-105, 40], width=15, height=15,
                         facecolor='none', edgecolor='tab:red',
                         transform=ccrs.PlateCarree())
ax.add_artist(rect_geo)

ax.coastlines()
ax.set_extent((-120, -65, 20, 55))

It'd be nice to make use of this in our own training.

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