spatialdata-plot
spatialdata-plot copied to clipboard
pl.render_labels can not color cell type annotation
Dear author,
I use below command, but the cell type annotation is not working for colors:
sdata_crop1.pl.render_labels("cell_labels", color="Celltype",
table_name='table2').pl.show(title="Cell labels",
dpi=300,
coordinate_systems="global")
Output figure contains no cell type colors:
Could you please confirm if this function is able to render colors for different cell types?
Thank you!
Best, Yang
I use render shape also failed with colors:
sdata_crop1.pl.render_shapes("cell_boundaries", color="Celltype",
table_name='table2').pl.show(title="Cell labels",
dpi=300,
coordinate_systems="global")
Output figure:
But same data, use cell_circles is ok:
sdata_crop1.pl.render_shapes("cell_circles", color="Celltype",
table_name='table2').pl.show(title="Cell labels",
dpi=300,
coordinate_systems="global")
Output figure:
Hey @liuyang2006, that's probably because your table doesn't annotate the cell_labels object but only the cell_circles object. That's currently the default for Xenium.
You can find a tutorial on how to fix that here: https://github.com/ccb-hms/Spatial-Workshop/blob/main/notebooks/nb2_static_plotting.ipynb
I will take that issue here as an occasion to improve the logging though.