Skip to content

Coloring labels by a continuous variable appears to be broken (labels associated with wrong colors) #342

Description

@clwgg

My testing code:

import spatialdata as sd
import spatialdata_plot
import matplotlib.pyplot as plt
import numpy as np

sdata = sd.datasets.blobs()
sdata.pl.render_labels("blobs_labels", color="channel_0_sum").pl.show()

Previously (here I used commit c6575e2) this would look something like this:

However, since e97a7fc, this looks like this:

Just to make sure that the first plot is correct, I extracted the labels where channel_0_sum is high, which shows that the two labels shown in yellow and green in the first plot are indeed the ones with the highest values:

highid = sdata.table.obs[sdata.table[:,'channel_0_sum'].X.toarray() > 1000].instance_id
plt.imshow(np.isin(sdata['blobs_labels'], highid))

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