theme_heatmap: A ggplot theme for heatmap plots

View source: R/theme_heatmap.R

theme_heatmapR Documentation

A ggplot theme for heatmap plots

Description

theme_heatmap produces a ggplot heatmap plot from a data.frame

Usage

theme_heatmap(xaxis_labels = TRUE, yaxis_labels = TRUE, ...)

Arguments

xaxis_labels

logical whether axis labels are printed, default=TRUE

yaxis_labels

logical whether axis labels are printed, default=TRUE

...

Other arguments passed on to theme_void

Details

This is a ggplot theme for heatmap plots. For categorical axes, it is theme_void with x and y axis labels It also has grey dotted grid lines and the legend is place at the top

If both x and y variables are continuous, theme_minimal is returned

Value

ggplot theme object

Examples


set.seed(20962)
test_data_cat <- data.frame(x = factor(rep(LETTERS[1:10], 10)),
  y = factor(rep(1:10, each = 10), levels = 10:1),
  size = sample(20:100, 100, replace = TRUE),
  fill = runif(100))

cat_heatmap_plot <- heatmap_plot(test_data_cat)
cat_heatmap_plot + theme_heatmap() + theme(axis.text.x = element_text(angle = 0, face = 'italic'))


richysix/biovisr documentation built on Feb. 3, 2024, 4:36 a.m.