show_pixels: Show Pixels

Description Usage Arguments Examples

View source: R/show.R

Description

Creates an HTMLWidget to show pixels.

Usage

1
2
3
4
show_pixels(pixels = NULL, grid = c(28, 28), size = c(250, 250),
  brush = matrix(c(0, 0.5, 0.8, 0.5, 0, 0.5, 1, 1, 1, 0.5, 0.8, 1, 1, 1, 0.8,
  0.5, 1, 1, 1, 0.5, 0, 0.5, 0.8, 0.5, 0), 5, 5), params = list(fill =
  list(color = "#555555"), grid = list(color = "#EEEEEE")))

Arguments

pixels

The pixels to render as a 1-dimensional vector, row-first order expected.

grid

The grid dimensions specified as a c(width, height) vector.

size

The canvas dimensions specified as a c(width, height) vector.

brush

The brush specified as a matrix.

params

A set of parameters to customize the visual appearance.

Examples

1
2
3
4
5
6
7
library(pixels)
show_pixels(
  round(runif(400, 0, 1)),
  grid = c(40, 10),
  size = c(800, 200),
  params = list(fill = list(color = "#FF3388"))
)

javierluraschi/pixels documentation built on Dec. 7, 2020, 4:44 a.m.