Closed sopvdl closed 1 year ago
Thanks for the fix @timtreis and @Sonja-Stockhaus!
@sopvdl the issue should be fixed now using the latest main
version of spatialdata-plot
.
Awesome thanks for the fix it's working now!
But I do notice when I'm now plotting with the groups
argument, the na_color
argument doesn't seem to be working anymore. As in the cells that are not in the groups will not be plotted and specifying a color with na_color
has no effect. Are you also seeing this?
Yes, this is actually the intended behaviour for groups
, analog to scanpy
or squidpy
.
One easy way to achieve your desired output would be to add a new entry in obs
in which you store this annotation, for example like this
sdata.table.obs["new_cluster"] = "NA"
sdata.table.obs.loc[sdata.table.obs.array_row==15.0, "new_cluster"] = "celltype_A"
sdata.table.obs.loc[sdata.table.obs.array_row==47.0, "new_cluster"] = "celltype_B"
sdata.table.obs.new_cluster = sdata.table.obs.new_cluster.astype("category")
sdata.pl.render_shapes("ST8059048_shapes", color="new_cluster", palette=["grey", "red", "blue"]).pl.show()
Hi there, thanks for this great tool! Super useful so far, but I'm running into some issues trying specify colors for categorical values with
pl.render_shapes()
.Specifying colors with the
palette
argument, I get my desired colors in the legend but not in the plot itself.I've tried many things, also without the
groups
argument but so far haven't been able to usepalette
to specify colors for categorical values in the plot itself. Would be great to be able to do this because the standard colors can be hard to see :)