# How to use the cartopy.feature.LAKES function in Cartopy

## To help you get started, weâ€™ve selected a few Cartopy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

Unidata / MetPy / tutorials / xarray_tutorial.py View on Github
``````length=6)

# Plot heights and temperature as contours
h_contour = ax.contour(x, y, data_level['height'], colors='k', levels=range(5400, 6000, 60))
h_contour.clabel(fontsize=8, colors='k', inline=1, inline_spacing=8,
fmt='%i', rightside_up=True, use_clabeltext=True)
t_contour = ax.contour(x, y, data_level['temperature'], colors='xkcd:deep blue',
levels=range(-26, 4, 2), alpha=0.8, linestyles='--')
t_contour.clabel(fontsize=8, colors='xkcd:deep blue', inline=1, inline_spacing=8,
fmt='%i', rightside_up=True, use_clabeltext=True)

edgecolor='#c7c783', zorder=0)

# Set a title and show the plot
ax.set_title('500 hPa Heights (m), Temperature (\u00B0C), Humidity (%) at '
+ time[0].dt.strftime('%Y-%m-%d %H:%MZ').item())
plt.show()``````
clcr / pyeo / pyeo / Test_plotting_overlays.py View on Github
``````# and these cover a margin below the main map
left2 = left1
right2 = right1
bottom2 = bottom1
top2 = bottom1 + 0.2 * (top1 - bottom1)

# now we overlay a new axes object on to the plot
# These are in unitless percentages of the figure size. (0,0 is bottom left)
left, bottom, width, height = [0.05, 0.3, 0.9, 0.6]
ax1 = fig.add_axes([left, bottom, width, height], projection=tifproj)

ax1.coastlines(resolution='10m', color='navy', linewidth=1)
ax1.gridlines()
BORDERS.scale = '10m'

# axes ticks
xticks = np.arange(left1, right1, 100000)
yticks = np.arange(bottom1, top1, 100000)
ax1.set_xticks(xticks, crs=tifproj)
ax1.set_yticks(yticks, crs=tifproj)
# stagger x gridline / tick labels
#labels = ax1.set_xticklabels(xticks)
#for i, label in enumerate(labels):
#    label.set_y(label.get_position()[1] - (i % 2) * 0.1)
# rotate the font orientation of the axis tick labels
plt.setp(ax1.get_xticklabels(), rotation=30, horizontalalignment='right')``````
Unidata / MetPy / tutorials / xarray_tutorial.py View on Github
``````length=6)

# Plot heights and temperature as contours
h_contour = ax.contour(x, y, data_level['height'], colors='k', levels=range(5400, 6000, 60))
h_contour.clabel(fontsize=8, colors='k', inline=1, inline_spacing=8,
fmt='%i', rightside_up=True, use_clabeltext=True)
t_contour = ax.contour(x, y, data_level['temperature'], colors='xkcd:deep blue',
levels=range(-26, 4, 2), alpha=0.8, linestyles='--')
t_contour.clabel(fontsize=8, colors='xkcd:deep blue', inline=1, inline_spacing=8,
fmt='%i', rightside_up=True, use_clabeltext=True)

edgecolor='#c7c783', zorder=0)

# Set a title and show the plot
ax.set_title('500 hPa Heights (m), Temperature (\u00B0C), Humidity (%) at '
+ time[0].dt.strftime('%Y-%m-%d %H:%MZ').item())
plt.show()``````
Unidata / MetPy / examples / plots / Station_Plot_with_Layout.py View on Github
``````custom_layout.add_value('NW', 'air_temperature', fmt='.1f', units='degF', color='darkred')
color='darkgreen')

# Also, we'll add a field that we don't have in our dataset. This will be ignored

# Create the figure and an axes set to the projection
fig = plt.figure(figsize=(20, 10))
ax = fig.add_subplot(1, 1, 1, projection=proj)

# Add some various map elements to the plot to make it recognizable

# Set plot bounds
ax.set_extent((-118, -73, 23, 50))

#
# Here's the actual station plot
#

# Start the station plot by specifying the axes to draw on, as well as the
# lon/lat of the stations (with transform). We also the fontsize to 12 pt.
stationplot = StationPlot(ax, data['longitude'], data['latitude'],
transform=ccrs.PlateCarree(), fontsize=12)``````
Unidata / MetPy / v0.6 / _downloads / Station_Plot_with_Layout.py View on Github
``````# The payoff
# ----------

# Change the DPI of the resulting figure. Higher DPI drastically improves the
# look of the text rendering
plt.rcParams['savefig.dpi'] = 255

# Create the figure and an axes set to the projection
fig = plt.figure(figsize=(20, 10))
ax = fig.add_subplot(1, 1, 1, projection=proj)

# Add some various map elements to the plot to make it recognizable
ax.coastlines(resolution='110m', zorder=2, color='black')

# Set plot bounds
ax.set_extent((-118, -73, 23, 50))

#
# Here's the actual station plot
#

# Start the station plot by specifying the axes to draw on, as well as the
# lon/lat of the stations (with transform). We also the fontsize to 12 pt.
stationplot = StationPlot(ax, data['longitude'], data['latitude'],
transform=ccrs.PlateCarree(), fontsize=12)``````
Unidata / MetPy / examples / XArray_Projections.py View on Github
``````from metpy.testing import get_test_data

ds = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False))
data_var = ds.metpy.parse_cf('Temperature')

x = data_var.x
y = data_var.y
im_data = data_var.isel(time=0).sel(isobaric=1000.)

fig = plt.figure(figsize=(14, 14))
ax = fig.add_subplot(1, 1, 1, projection=data_var.metpy.cartopy_crs)

ax.imshow(im_data, extent=(x.min(), x.max(), y.min(), y.max()),
cmap='RdBu', origin='lower' if y[0] &lt; y[-1] else 'upper')
ax.coastlines(color='tab:green', resolution='10m')

plt.show()``````
Unidata / siphon / examples / acis / Mapping_Example.py View on Github
``````#
# This should help us visualize where the precipitation event was strongest!

proj = ccrs.LambertConformal(central_longitude=-105, central_latitude=0,
standard_parallels=[35])

fig = plt.figure(figsize=(20, 10))
ax = fig.add_subplot(1, 1, 1, projection=proj)

state_boundaries = feat.NaturalEarthFeature(category='cultural',
scale='110m', facecolor='none')

ax.coastlines(resolution='110m', zorder=2, color='black')

# Set plot bounds
ax.set_extent((-109.9, -101.8, 36.5, 41.3))

# Plot each station, labeling based on departure
for stn in range(len(pcpn)):
if pcpn_dep[stn] &gt;= 0 and pcpn_dep[stn] &lt; 2:
ax.plot(lon[stn], lat[stn], 'g+', markersize=7, transform=ccrs.Geodetic())
ax.text(lon[stn], lat[stn], pcpn[stn], transform=ccrs.Geodetic())
elif pcpn_dep[stn] &gt;= 2:
ax.plot(lon[stn], lat[stn], 'm+', markersize=7, transform=ccrs.Geodetic())
ax.text(lon[stn], lat[stn], pcpn[stn], transform=ccrs.Geodetic())
elif pcpn_dep[stn] &lt; 0:``````
holoviz / geoviews / geoviews / feature.py View on Github
``````from cartopy import feature as cf

from .element import Feature

borders   = Feature(cf.BORDERS, group='Borders')
coastline = Feature(cf.COASTLINE, group='Coastline')
land      = Feature(cf.LAND, group='Land')
lakes     = Feature(cf.LAKES, group='Lakes')
ocean     = Feature(cf.OCEAN, group='Ocean')
rivers    = Feature(cf.RIVERS, group='Rivers')
states    = FEATURE(cf.STATES, group='States')
grid      = Feature(cf.NaturalEarthFeature(category='physical',
name='graticules_30',
scale='110m'), group='Grid')``````
ResidentMario / geoplot / docs / gallery / plot_los_angeles_flights.py View on Github
``````)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.gridlines()
ax.coastlines()

ax = gplt.sankey(
la_flights, scale='Passengers', hue='Passengers', cmap='Purples', ax=axarr[1][1]
)
ax.set_global()
ax.outline_patch.set_visible(True)
ax.coastlines()

clcr / pyeo / pyeo / Sen2Map.py View on Github
``````shape_feature = ShapelyFeature(Reader(shapefile).geometries(),
crs=shapeproj, edgecolor='yellow',
facecolor='none')

plt.title(plottitle)

# set map extent
ax.set_extent(mapextent, tifproj)

ax.coastlines(resolution='10m', color='navy', linewidth=1)

BORDERS.scale = '10m'

# format the gridline positions nicely
xticks, yticks = get_gridlines(mapextent[0], mapextent[1],
mapextent[2], mapextent[3],
nticks=10)

gl = ax.gridlines(crs=tifproj, xlocs=xticks, ylocs=yticks,
linestyle='--', color='grey', alpha=1, linewidth=1)