add_label | R Documentation |
This function is designed to be used with scater::plotReducedDim()
from the scater package without specifying text label (i.e. via
text_by
). Then use add_label()
to place labels centrally.
add_label(
sce,
dimname = "TSNE",
text_by = "label",
text_type = "text",
text_size = 8,
text_color = "black",
box.padding = 0.5,
max.overlaps = 20
)
sce |
A |
dimname |
A string or integer scalar indicating the reduced dimension
result in |
text_by |
A string indicating the column metadata field with which to
add text labels on the plot. Alternatively, a character vector of the same
length as |
text_type |
A string indicating to add text directly to the plot
( |
text_size |
A numeric scalar indicating the size of the label. This
is passed to |
text_color |
A string indicating the colour of the label. This is
passed to |
box.padding |
A scalar indicating the amount of padding around
bounding box, as unit or number. This is passed to |
max.overlaps |
Exclude text labels that overlap too many things.
This is passed to |
The repel-away-from-center behaviour in plotReducedDim()
should
be fixed in scater v1.23.5.
A geom
(geometric object)
I-Hsuan Lin
scater::plotReducedDim()
library(scater)
# Load demo dataset
data(sce)
plotReducedDim(sce, "TSNE", colour_by = "label") + add_label(sce, "TSNE")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.