This function creates a scatter plot of spatial coordinates colored by labels. It is useful for visualizing spatial transcriptomics or spatial data with sample annotations.
Arguments
- coordinate
A data frame containing spatial coordinates. Must have columns named 'X' and 'Y'. Row names should correspond to spots or cells.
- label
A named vector or factor of labels corresponding to the rows of `coordinate`. The function will reorder the labels to match the coordinate row order.
- size
Numeric. The size of the points in the plot. Default is 1.