map_axis_labels: Color axis labels

Description Usage Arguments Value Examples

View source: R/ggplot2-utils.R

Description

Color axis labels

Usage

1
2
3
4
5
6
7
map_axis_labels(
  plt,
  label_data_x = NULL,
  label_data_y = NULL,
  aes_label,
  scale = ggplot2::scale_color_hue(aesthetics = "axis_color")
)

Arguments

plt

ggplot2::ggplot() object

label_data_x

data.frame() containing the mapping between x-axis labels and aes_label

label_data_y

data.frame() containing the mapping between y-axis labels and aes_label

aes_label

character or bare symbol giving the column in label_data to be mapped

scale

ggplot2 discrete color

Value

plt with axis text modified

Examples

1
2
3
4
5
6
require(ggplot2)
require(dplyr)
plt = ggplot(mpg, aes(x = manufacturer, y = drv)) + geom_jitter()
label_data = mpg %>% select(manufacturer) %>% unique() %>%
mutate(euro = manufacturer %in% c('audi', 'volkswagen'))
map_axis_labels(plt, label_data_x = label_data, aes_label = euro)

CellaRepertorium documentation built on Nov. 8, 2020, 7:48 p.m.