MortonGlyph: Morton curve data visualization

Description Usage Arguments Value Author(s) Examples

View source: R/Morton_combine.R

Description

MortonGlyph generates a data matrix of png format or a class of "pixmap" which can be used to display color strings in an order of Morton curve in the space given a vector of colors

Usage

1
MortonGlyph(col, fill = FALSE, type = c("png", "pixmap"))

Arguments

col

vector of colors

fill

logical value indicating whether the color strings repeat from the beginning if number of colors is smaller than the total length of Morton curve

type

string specifying the format of output. "png" means the output is a data matrix in the png format, and "pixmap" means the output is a class of pixmap.

Value

a data matrix of png format or a class of "pixmap" which can be used to plot. See pixmap, writePNG, rasterImage

Author(s)

Jiahua Liu, Wayne Oldford

Examples

1
2
3
4
5
6
7
8
9
myPngmat <- MortonGlyph()
myPngmat <- MortonGlyph(col = colors())
myPngmat <- MortonGlyph(col = colors(), fill = TRUE)
writePNG(myPngmat, target = "myplot.png")
plot(0,type='n', xlim=c(0,1), ylim=c(0,1), axes = FALSE, xlab = "", ylab = "")
rasterImage(myPngmat,0,0,1,1)
mypixmap <- MortonGlyph(type = "pixmap")
mypixmap <- MortonGlyph(col = colors(), fill = TRUE, type = "pixmap")
plot(mypixmap)

rwoldford/glyphs documentation built on Nov. 14, 2020, 2:29 a.m.