View source: R/geom_gene_label.R
geom_gene_label | R Documentation |
geom_gene_label()
can be used to add a text label to genes drawn with
geom_gene_arrow()
.
geom_gene_label(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
na.rm = FALSE,
show.legend = FALSE,
inherit.aes = TRUE,
padding.x = grid::unit(1, "mm"),
padding.y = grid::unit(0.1, "lines"),
align = "centre",
min.size = 4,
grow = F,
reflow = F,
height = grid::unit(3, "mm"),
...
)
mapping, data, stat, position, na.rm, show.legend, inherit.aes, ... |
Standard
geom arguments as for |
padding.x, padding.y |
|
align |
Where inside the gene to place the text label. Default is 'centre'; other options are 'left' and 'right'. |
min.size |
Minimum font size, in points. If provided, text that would need to be shrunk below this size to fit inside the gene arrow will not be drawn. Defaults to 4 pt. |
grow |
If |
reflow |
If |
height |
|
geom_gene_label()
uses the 'ggfittext' package to fit text to genes. All
text drawing options available in ggfittext::geom_fit_text()
(growing,
reflowing, etc.) are also available here. For full details on how these
options work, see the documentation for ggfittext::geom_fit_text()
.
Standard 'ggplot2' aesthetics for text are supported (see Aesthetics).
xmin,xmax (start and end of the gene; required)
y (molecule; required)
label (the label text; required)
colour
size
alpha
family
fontface
angle
geom_gene_arrow
ggplot2::ggplot(example_genes, ggplot2::aes(xmin = start, xmax = end,
y = molecule, fill = gene, label = gene)) +
geom_gene_arrow() +
geom_gene_label() +
ggplot2::facet_wrap(~ molecule, ncol = 1, scales = "free") +
theme_genes()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.