Skip to content

Commit

Permalink
map neighbors edgecolor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanplanders committed Jun 21, 2024
1 parent 36156e5 commit b0b34b7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pyleoclim/core/geoseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def map(self, projection='Orthographic', proj_default=True,
def map_neighbors(self, mgs, radius=3000, projection='Orthographic', proj_default=True,
background=True, borders=False, rivers=False, lakes=False, ocean=True,
land=True, fig=None, gridspec_slot=None,
figsize=None, marker='archiveType', hue='archiveType', size=None, edgecolor='w',
figsize=None, marker='archiveType', hue='archiveType', size=None, edgecolor=None,#'w',
markersize=None, scatter_kwargs=None, cmap=None, colorbar=False, gridspec_kwargs=None,
legend=True, lgd_kwargs=None, savefig_settings=None):

Expand Down Expand Up @@ -522,11 +522,21 @@ def map_neighbors(self, mgs, radius=3000, projection='Orthographic', proj_defaul
df_self = mapping.make_df(self, hue=hue, marker=marker, size=size)

neighborhood = pd.concat([df, df_self], axis=0)

# additional columns are added manually
neighbor_coloring = ['w' for ik in range(len(neighborhood))]
neighbor_coloring[-1] = 'k'

neighbor_status = ['neighbor' for ik in range(len(neighborhood))]
neighbor_status[-1] = 'target'
neighborhood['neighbor_status'] = neighbor_status

if edgecolor is None:
edgecolor = 'k'
if isinstance(scatter_kwargs, dict):
edgecolor = scatter_kwargs.pop('edgecolor', 'k')

neighbor_coloring[-1] = edgecolor
neighborhood['original'] =neighbor_coloring
neighborhood['neighbors'] =neighbor_coloring

# plot neighbors

Expand Down

0 comments on commit b0b34b7

Please sign in to comment.