From 1c98254392fce853568c60f64d5ac16214cd118a Mon Sep 17 00:00:00 2001 From: Pablo Lichtig Date: Thu, 8 Aug 2024 10:22:28 -0600 Subject: [PATCH 1/6] Add capability to plot counties --- monet/plots/mapgen.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/monet/plots/mapgen.py b/monet/plots/mapgen.py index c46df07e..243933ae 100644 --- a/monet/plots/mapgen.py +++ b/monet/plots/mapgen.py @@ -70,6 +70,15 @@ def draw_map( linewidth=linewidth, ) + if counties: + counties = cfeature.NaturalEarthFeature( + category='cultural', + name='admin_2_counties', + scale=resolution, + facedolor='none', + edgecolor='k', + linewidth=linewidth, + if coastlines: ax.coastlines(resolution, linewidth=linewidth) From 7636ae61019ef858179cc9ec74023567189042a4 Mon Sep 17 00:00:00 2001 From: Pablo Lichtig Date: Thu, 8 Aug 2024 10:26:39 -0600 Subject: [PATCH 2/6] Add capability to plot counties, fix bugs --- monet/plots/mapgen.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monet/plots/mapgen.py b/monet/plots/mapgen.py index 243933ae..566a2a27 100644 --- a/monet/plots/mapgen.py +++ b/monet/plots/mapgen.py @@ -8,6 +8,7 @@ def draw_map( crs=None, natural_earth=False, coastlines=True, + counties=False, states=False, countries=True, resolution="10m", @@ -78,6 +79,7 @@ def draw_map( facedolor='none', edgecolor='k', linewidth=linewidth, + ) if coastlines: ax.coastlines(resolution, linewidth=linewidth) @@ -88,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) From 6d65d72dceb165b6362d376b95445269b122814f Mon Sep 17 00:00:00 2001 From: Pablo Lichtig Date: Thu, 8 Aug 2024 10:33:08 -0600 Subject: [PATCH 3/6] Correct typo facedolor -> facecolor --- monet/plots/mapgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monet/plots/mapgen.py b/monet/plots/mapgen.py index 566a2a27..ddddaa21 100644 --- a/monet/plots/mapgen.py +++ b/monet/plots/mapgen.py @@ -76,7 +76,7 @@ def draw_map( category='cultural', name='admin_2_counties', scale=resolution, - facedolor='none', + facecolor='none', edgecolor='k', linewidth=linewidth, ) From aecbb6b699bd594c893af6f2673d72941084e0b4 Mon Sep 17 00:00:00 2001 From: Pablo Lichtig Date: Thu, 5 Sep 2024 10:32:37 -0600 Subject: [PATCH 4/6] Update monet/plots/mapgen.py Co-authored-by: Zachary Moon --- monet/plots/mapgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monet/plots/mapgen.py b/monet/plots/mapgen.py index ddddaa21..2148008b 100644 --- a/monet/plots/mapgen.py +++ b/monet/plots/mapgen.py @@ -8,8 +8,8 @@ def draw_map( crs=None, natural_earth=False, coastlines=True, - counties=False, states=False, + counties=False, countries=True, resolution="10m", extent=None, From 59f94043f5f3dbc8404e3267fadf48d5e2c9f116 Mon Sep 17 00:00:00 2001 From: blychs Date: Thu, 5 Sep 2024 10:36:09 -0600 Subject: [PATCH 5/6] Correct linting (black) --- monet/plots/mapgen.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monet/plots/mapgen.py b/monet/plots/mapgen.py index 2148008b..76b4c155 100644 --- a/monet/plots/mapgen.py +++ b/monet/plots/mapgen.py @@ -73,13 +73,13 @@ def draw_map( if counties: counties = cfeature.NaturalEarthFeature( - category='cultural', - name='admin_2_counties', + category="cultural", + name="admin_2_counties", scale=resolution, - facecolor='none', - edgecolor='k', + facecolor="none", + edgecolor="k", linewidth=linewidth, - ) + ) if coastlines: ax.coastlines(resolution, linewidth=linewidth) From 95757ee814903802923d4a6cf22ff2d708415c65 Mon Sep 17 00:00:00 2001 From: blychs Date: Thu, 5 Sep 2024 11:05:15 -0600 Subject: [PATCH 6/6] Add line to .codespell-exclude Exclude taylordiagram.py:12: --- .codespell-exclude | 1 + 1 file changed, 1 insertion(+) diff --git a/.codespell-exclude b/.codespell-exclude index e0acf9b6..69c825df 100644 --- a/.codespell-exclude +++ b/.codespell-exclude @@ -4,3 +4,4 @@ "ALL", "All of the above retrievals (SIZ to FLX) in one file" CAf CAf +__author__ = "Yannick Copin "