ggpixel: Plot a word on tiles

Description Usage Arguments Value Examples

View source: R/plot.R

Description

The method takes a string and translates it into a tile plot using ggplot2. The resulting lpot looks like a heamtap with a string engraved.

Usage

1
2
3
4
5
ggpixel(x, noise.difference = 5, color.palette = c("viridis", "magma",
  "plasma", "inferno"), margin.left = 5, margin.right = 5,
  margin.top = 10, margin.bottom = 10, letter.spacing = 3,
  overlay = NULL, overlay.radius = 20, overlay.color = "white",
  na.value = "white", color = "grey30", aspect.ratio = 0.1)

Arguments

x

a character vector

noise.difference

numeric value that is added to the letter tiles in order to create a contrast. The higher the stronger the contrast.

color.palette

obviously the colorpalette. One of the viridis colors.

margin.left

how many pixels are inserted to the left from the string

margin.right

how many pixels are inserted to the right from the string

margin.top

how many pixels are inserted to the top from the string

margin.bottom

how many pixels are inserted to the bottom from the string

letter.spacing

how many pixels are used for spacing two characters

overlay

how many corners the overlay will have. Per default (NULL) no overlay is used

overlay.radius

how many pixels the radius of the overlay will be

overlay.color

the color of the overlay

na.value

color used for NAs

color

color used for the lines separating the tiles

aspect.ratio

ggplot2 aspect.ratio parameter. Modifies the dimensions of the tiles.

Value

returns a ggplot object

Examples

1
2
3
4
5
6
## Not run: 
  obiwan <- ggpixel("hello there!")

  grievous <- ggpixel("general kenobi!", 3, "magma", 10, 10, 10, 10)

## End(Not run)

dirmeier/ggpixel documentation built on Jan. 24, 2020, 12:46 p.m.