Skip to content

Commit 6fe5ecc

Browse files
committed
added tests for plotting columns from points
1 parent e6ed752 commit 6fe5ecc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/pl/test_render_points.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import matplotlib.pyplot as plt
66
import numpy as np
77
import pandas as pd
8+
import pytest
89
import scanpy as sc
910
from anndata import AnnData
1011
from spatialdata import SpatialData, deepcopy
@@ -111,6 +112,14 @@ def test_plot_datashader_continuous_color(self, sdata_blobs: SpatialData):
111112
element="blobs_points", size=40, color="instance_id", alpha=0.6, method="datashader"
112113
).pl.show()
113114

115+
@pytest.mark.parametrize("method", ["matplotlib", "datashader"])
116+
def test_plot_points_categorical_color_column(self, sdata_blobs: SpatialData, method: str):
117+
sdata_blobs.pl.render_points("blobs_points", color="genes", method=method).pl.show()
118+
119+
@pytest.mark.parametrize("method", ["matplotlib", "datashader"])
120+
def test_plot_points_continuous_color_column(self, sdata_blobs: SpatialData, method: str):
121+
sdata_blobs.pl.render_points("blobs_points", color="instance_id", method=method).pl.show()
122+
114123
def test_plot_datashader_matplotlib_stack(self, sdata_blobs: SpatialData):
115124
sdata_blobs.pl.render_points(
116125
element="blobs_points", size=40, color="red", method="datashader"

0 commit comments

Comments
 (0)