ggheatmap
add_tracks.Rd
add_tracks() is a shortcut for building a new panel of ggplot2::geom_tile()
s
with track_columns
and adding it to the ggheatmap
. It works if track_columns
are included in ggData(gghm)
.
add_tracks(
gghm,
track_columns,
track_colors = list(),
pal_dir = 1,
track_prop = 0.3,
leg_ncol = 3,
fontsize = 11,
track_pos = "bottom",
legend_action = "collect",
show_legend = TRUE
)
An ggplot object of class ggheatmap
.
A vector with names of columns to be plotted.
A named list where names are the same as track_columns
.
Can be either:
NULL, in which case all colors will be chosen automatically.
A valid palette used by RColorBrewer
. See: RColorBrewer::display.brewer.all()
A named vector of colors passed to ggplot2::scale_fill_manual()
.
palette direction, used if track_colors
is a palette name.
See: ggplot2::scale_color_brewer()
A number between 0 and 1, representing the height proportion between new tracks and the heatmap.
Number of columns in the track legends. Passed to
ggplot2::guide_legend()
.
Base fontsize for plot, which will be used by the theme.
Ultimately passed to ggplot2::theme_minimal()
as base_size
.
One of: 'bottom' or 'top'.
A string specifying how guides should be treated in the layout.
See: guides in patchwork::plot_layout()
.
If FALSE, no legend is added to the ggheatmap for the tracks