hc_png-HilbertCurve-method {HilbertCurve} | R Documentation

## Save Hilbert curve as a PNG figure

### Description

Save Hilbert curve as a PNG figure

### Usage

    ## S4 method for signature 'HilbertCurve'
    hc_png(object, file = "HilbertCurve.png")

### Arguments

`object` | A `HilbertCurve-class` 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.

### 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.

### Value

No value is returned.

### Author(s)

Zuguang Gu <z.gu@dkfz.de>

### Examples

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

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

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

[Package HilbertCurve version 1.20.0 Index]