plot.bm_bitmap {bittermelon}R Documentation

Plot bitmap object

Description

plot.bm_bitmap() plots a bitmap object to the graphics device. It is a wrapper around grid::grid.raster() and as.raster.bm_bitmap() which converts a bitmap glyph object to a raster object.

Usage

## S3 method for class 'bm_bitmap'
plot(x, ..., col = c("grey80", "black", "grey40"), interpolate = FALSE)

## S3 method for class 'bm_bitmap'
as.raster(x, ..., col = c("grey80", "black", "grey40"))

Arguments

x

A bm_bitmap() object

...

Passed to grid::grid.raster().

col

Character vector of R color specifications.

interpolate

Passed to grid::grid.raster().

Value

A grid rastergrob grob object silently. As a side effect will draw to graphics device.

See Also

bm_bitmap(), as.raster.bm_bitmap()

Examples

  font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
  font <- read_hex(font_file)
  capital_r <- bm_extend(font[[str2ucp("R")]], left = 1L)
  capital_r <- bm_extend(capital_r, sides = 1L, value = 2L)  # add a border effect

  plot(capital_r)

  grid::grid.newpage()
  plot(capital_r, col = c("yellow", "blue", "red"))

[Package bittermelon version 1.1.2 Index]