Skip to content

Commit 88c018b

Browse files
committed
add baseline to test
1 parent 179951b commit 88c018b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
-14.5 KB
Loading
-14.5 KB
Loading

tests/pl/test_render_images.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy as np
44
import scanpy as sc
55
import spatialdata_plot # noqa: F401
6+
from matplotlib import pyplot as plt
67
from matplotlib.colors import Normalize
78
from spatial_image import to_spatial_image
89
from spatialdata import SpatialData
@@ -70,11 +71,15 @@ def test_plot_can_render_two_channels_str_from_multiscale_image(self, sdata_blob
7071
sdata_blobs_str.pl.render_images(element="blobs_multiscale_image", channel=["c1", "c2"]).pl.show()
7172

7273
def test_plot_can_pass_vmin_vmax(self, sdata_blobs: SpatialData):
73-
sdata_blobs.pl.render_images(element="blobs_image", channel=1, vmin=0, vmax=0.4).pl.show()
74+
fig, axs = plt.subplots(ncols=2, figsize=(6, 3))
75+
sdata_blobs.pl.render_images(element="blobs_image", channel=1).pl.show(ax=axs[0])
76+
sdata_blobs.pl.render_images(element="blobs_image", channel=1, vmin=0, vmax=0.4).pl.show(ax=axs[1])
7477

7578
def test_plot_can_pass_normalize(self, sdata_blobs: SpatialData):
79+
fig, axs = plt.subplots(ncols=2, figsize=(6, 3))
7680
norm = Normalize(vmin=0, vmax=0.4, clip=True)
77-
sdata_blobs.pl.render_images(element="blobs_image", channel=1, norm=norm).pl.show()
81+
sdata_blobs.pl.render_images(element="blobs_image", channel=1).pl.show(ax=axs[0])
82+
sdata_blobs.pl.render_images(element="blobs_image", channel=1, norm=norm).pl.show(ax=axs[1])
7883

7984
def test_plot_can_pass_color_to_single_channel(self, sdata_blobs: SpatialData):
8085
sdata_blobs.pl.render_images(element="blobs_image", channel=1, palette="red").pl.show()

0 commit comments

Comments
 (0)