|
3 | 3 | import numpy as np
|
4 | 4 | import scanpy as sc
|
5 | 5 | import spatialdata_plot # noqa: F401
|
| 6 | +from matplotlib import pyplot as plt |
| 7 | +from matplotlib.colors import Normalize |
6 | 8 | from spatial_image import to_spatial_image
|
7 | 9 | from spatialdata import SpatialData
|
8 | 10 |
|
@@ -68,6 +70,17 @@ def test_plot_can_render_two_channels_str_from_image(self, sdata_blobs_str: Spat
|
68 | 70 | def test_plot_can_render_two_channels_str_from_multiscale_image(self, sdata_blobs_str: SpatialData):
|
69 | 71 | sdata_blobs_str.pl.render_images(element="blobs_multiscale_image", channel=["c1", "c2"]).pl.show()
|
70 | 72 |
|
| 73 | + def test_plot_can_pass_vmin_vmax(self, sdata_blobs: SpatialData): |
| 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]) |
| 77 | + |
| 78 | + def test_plot_can_pass_normalize(self, sdata_blobs: SpatialData): |
| 79 | + fig, axs = plt.subplots(ncols=2, figsize=(6, 3)) |
| 80 | + norm = Normalize(vmin=0, vmax=0.4, clip=True) |
| 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]) |
| 83 | + |
71 | 84 | def test_plot_can_pass_color_to_single_channel(self, sdata_blobs: SpatialData):
|
72 | 85 | sdata_blobs.pl.render_images(element="blobs_image", channel=1, palette="red").pl.show()
|
73 | 86 |
|
|
0 commit comments