Learn R Programming

HilbertCurve (version 1.2.2)

hc_png-HilbertCurve-method: Save Hilbert curve as a PNG figure

Description

Save Hilbert curve as a PNG figure

Usage

## S3 method for class 'HilbertCurve':
hc_png(object, file = "HilbertCurve.png")

Arguments

object
file
file name. If the suffix of the file name is not .png, it will be added automatically no matter you like it or not.

Value

  • No value is returned.

Details

A PNG figure with resolution of 2^level x 2^level is generated.

Only the body of the Hilbert curve will be written to PNG file.

This function only works under 'pixel' mode.

Examples

Run this code
hc = HilbertCurve(1, 100, level = 9, mode = "pixel")

x = sort(sample(100, 20))
s = x[1:10*2 - 1]
e = x[1:10*2]
ir = IRanges(s, e)

hc_layer(hc, ir)
hc_png(hc, file = "test.png")

Run the code above in your browser using DataLab