Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Harald Sager Voehringer committed Oct 13, 2022
1 parent a8f46b0 commit 0fa368e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "spat-data"
packages = [
{ include = "spatial_data" },
]
version = "0.2.1"
version = "0.2.2"
description = ""
authors = ["Harald Vohringer"]

Expand Down
11 changes: 8 additions & 3 deletions spatial_data/pl/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def scatter(
legend_label=False,
size: float = 0.001,
alpha: float = 0.9,
zorder=10,
ax=None,
legend_kwargs: dict = {"framealpha": 1},
) -> xr.Dataset:
Expand Down Expand Up @@ -162,7 +163,9 @@ def scatter(
obs_layer = label_subset[Layers.OBS]
x = obs_layer.loc[:, Features.X]
y = obs_layer.loc[:, Features.Y]
ax.scatter(x.values, y.values, s=size, c=color_dict[k], alpha=alpha)
ax.scatter(
x.values, y.values, s=size, c=color_dict[k], alpha=alpha, zorder=zorder
)

xmin, xmax, ymin, ymax = self._obj.pl._get_bounds()
ax.set_ylim([ymin, ymax])
Expand Down Expand Up @@ -372,7 +375,7 @@ def spectra_with_annotation(

return self._obj

def draw_edges(self, color="white", linewidths=0.5, ax=None):
def draw_edges(self, color="white", linewidths=0.5, zorder=0, ax=None):
# unpack data
coords = self._obj[Layers.OBS].loc[:, [Features.X, Features.Y]]
neighbors = self._obj[Layers.NEIGHBORS].values.reshape(-1)
Expand All @@ -395,7 +398,9 @@ def draw_edges(self, color="white", linewidths=0.5, ax=None):

# Line collection
# REFACTOR
lc = LineCollection(all_lines, colors=color, linewidths=linewidths, zorder=-10)
lc = LineCollection(
all_lines, colors=color, linewidths=linewidths, zorder=zorder
)
if ax is None:
ax = plt.gca()

Expand Down

0 comments on commit 0fa368e

Please sign in to comment.