Skip to content

norm doesn't have impact for single image channel rendering when clip=False #418

Closed

Description

@Sonja-Stockhaus
from matplotlib.colors import Normalize
from matplotlib import rcParams
import spatialdata_plot
from spatialdata.datasets import blobs

blob=blobs()

cmap = matplotlib.colormaps[rcParams["image.cmap"]]
cmap.set_under("black")
cmap.set_over("grey")

norm = Normalize(vmin=0.3, vmax=0.7, clip=False)

blob.pl.render_images(element="blobs_image", channel=0, norm=norm, cmap=cmap).pl.show()

The result looks like the original image when you render channel 0 without any norm, except for the colorbar:

Image

This is because imshow() gets the already normalized data, but doesn't know that - so it autoranges to show everything on the colormap.
When passing the Normalize object directly to the norm argument of imshow, we get the desired behavior:

Image

Activity

  1. timtreis commented on Mar 29, 2026

    @timtreis
    Member

    Fixed via #419

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

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions