Skip to content

Unable to set vmin and vmax when plotting raster data #303

Description

@LucaMarconato

I am trying to plot some raster data with a different normalization (vmin, vmax) for the cmap. Both approaches I used unfortunately don't work, can you have a look at this please?

from spatialdata.datasets import blobs
import spatialdata_plot
import matplotlib.colors
import matplotlib.pyplot as plt

sdata = blobs()

sdata['single_channel'] = sdata['blobs_image'].sel(c=slice(0, 0))

# original
sdata.pl.render_images('single_channel').pl.show()
plt.show()

# attempt 1, doesn't work
sdata.pl.render_images('single_channel', vmin=0, vmax=0.4).pl.show()
plt.show()

# attempt 2, doesn't work
norm = matplotlib.colors.Normalize(vmin=0, vmax=0.4)
sdata.pl.render_images('single_channel', norm=norm).pl.show()
plt.show()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions