seurat
seurat copied to clipboard
Colors in SpatialDimPlot() for multiple slides
Dear Seurat Team,
# cols - vector with colors
SpatialDimPlot(spatialData, cols= cols)
The cols
parameter changes the colors. However, if I have multiple slide and not all clusters are represented on each slide, the color order changes and the colors between the slides do not fit together anymore. If I do not specify my own colors this is not the case, but with the default colors the different clusters are difficult to see.
Is there a way to fix this? Thank you so much!
Have you tried naming the colors based off their cluster label?
Example:
colors <- c(cluster1 = "red", cluster2 = "green")
Hi, I am closing this issue for now as we have not got any response. Will reopen it if there is any update.
I had the same problem and the solution from mojaveazure is working. However, I have to use c("1"="red" ,"2"="green")