plot_keyboard: Create a keyboard layout ggplot

Description Usage Arguments Details Value Examples

Description

Create a keyboard layout ggplot

Usage

1
plot_keyboard(user_plot, user_scale = "2cm")

Arguments

user_plot

bare name of a user-supplied plotting function. See details.

user_scale

overall scaling factor and unit, e.g. "2cm". See details.

Details

The user-supplied function should take a single argument (name is not important, but e.g. letter) which filters the plot to just the relevant letter. It should return the ggplot object. See demo(random_walk).

The scale is a text string, e.g. "2cm" which will be separated into a numeric and text component. The numeric component will scale the plot, while the text component sets the units.

Value

(invisibly) a gtable containing multiple grobs defining the keyboard plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
rw <- plot_keyboard(ggshape_random_walk)
ggsave(rw, filename = "random.png", width = 16, height = 6)

eng <- plot_keyboard(ggshape_english_usage)
ggsave(eng, filename = "english.png", width = 16, height = 6)

langs <- plot_keyboard(ggshape_lang_diffs)
ggsave(langs, filename = "languages.png", width = 16, height = 6)

## End(Not run)

YTLogos/ggshape documentation built on May 28, 2019, 3:21 p.m.