theme_bubble: A ggplot theme for bubble plots

View source: R/theme_bubble.R

theme_bubbleR Documentation

A ggplot theme for bubble plots

Description

theme_bubble produces a ggplot bubble plot from a data.frame

Usage

theme_bubble(base_size = 11, base_family = "", categorical = TRUE, ...)

Arguments

base_size

numeric base size of text in points (default: 11)

base_family

character base font family (default: "")

categorical

logical are either of the x and y variable categorical (default: TRUE)

...

Other arguments passed on to theme_void

Details

This is a ggplot theme for bubble 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_bubble_plot <- bubble_plot(test_data_cat)
cat_bubble_plot + theme_bubble() + theme(axis.text.x = element_text(angle = 0, face = 'italic'))


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