Skip to content

Commit

Permalink
Merge pull request #153 from blychs/develop
Browse files Browse the repository at this point in the history
Add capability to plot counties
  • Loading branch information
zmoon authored Sep 5, 2024
2 parents a6a7dc4 + 95757ee commit cb3d5b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .codespell-exclude
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
"ALL", "All of the above retrievals (SIZ to FLX) in one file"
<th>CAf</th>
<td>CAf</td>
__author__ = "Yannick Copin <[email protected]>"
14 changes: 14 additions & 0 deletions monet/plots/mapgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def draw_map(
natural_earth=False,
coastlines=True,
states=False,
counties=False,
countries=True,
resolution="10m",
extent=None,
Expand Down Expand Up @@ -70,6 +71,16 @@ def draw_map(
linewidth=linewidth,
)

if counties:
counties = cfeature.NaturalEarthFeature(
category="cultural",
name="admin_2_counties",
scale=resolution,
facecolor="none",
edgecolor="k",
linewidth=linewidth,
)

if coastlines:
ax.coastlines(resolution, linewidth=linewidth)

Expand All @@ -79,6 +90,9 @@ def draw_map(
if states:
ax.add_feature(states_provinces, linewidth=linewidth)

if counties:
ax.add_feature(counties, linewidth=linewidth)

if extent is not None:
ax.set_extent(extent)

Expand Down

0 comments on commit cb3d5b1

Please sign in to comment.