geom_bin_label | R Documentation |
Put bin labels left of the sequences. nudge_left
adds space relative to the
total bin width between the label and the seqs, by default 5%. expand_left
expands the plot to the left by 20% to make labels visible.
geom_bin_label(
mapping = NULL,
data = bins(),
hjust = 1,
size = 3,
nudge_left = 0.05,
expand_left = 0.2,
expand_x = NULL,
expand_aes = NULL,
yjust = 0,
...
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
hjust |
Moves the text horizontally |
size |
of the label |
nudge_left |
by this much relative to the widest bin |
expand_left |
by this much relative to the widest bin |
expand_x |
expand the plot to include this absolute x value |
expand_aes |
provide custom aes mappings for the expansion (advanced) |
yjust |
for multiline bins set to 0.5 to center labels on bins, and 1 to align labels to the bottom. |
... |
Other arguments passed on to
|
Set x
and expand_x
to an absolute position to align all labels at a
specific location
Bin labels are added as a text layer/component to the plot.
s0 <- read_seqs(list.files(ex("cafeteria"), "Cr.*\\.fa.fai$", full.names = TRUE))
s1 <- s0 %>% dplyr::filter(length > 5e5)
gggenomes(emale_genes) + geom_seq() + geom_gene() +
geom_bin_label()
# make larger labels and extra room on the canvas
gggenomes(emale_genes) + geom_seq() + geom_gene() +
geom_bin_label(size = 7, expand_left = .4)
# align labels for wrapped bins:
# top
gggenomes(seqs = s1, infer_bin_id = file_id, wrap = 5e6) +
geom_seq() + geom_bin_label() + geom_seq_label()
# center
gggenomes(seqs = s1, infer_bin_id = file_id, wrap = 5e6) +
geom_seq() + geom_bin_label(yjust = .5) + geom_seq_label()
# bottom
gggenomes(seqs = s1, infer_bin_id = file_id, wrap = 5e6) +
geom_seq() + geom_bin_label(yjust = 1) + geom_seq_label()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.