hc_text-HilbertCurve-method {HilbertCurve} | R Documentation

## Add text to Hilbert curve

### Description

Add text to Hilbert curve

### Usage

    ## S4 method for signature 'HilbertCurve'
    hc_text(object, ir, labels, x1 = NULL, x2 = x1, gp = gpar(), ...)

### Arguments

`object` | A `HilbertCurve-class` object.
`ir` | an `IRanges` object that contains positions which correspond to text. The middle point of the interval will be the position of the text.
`labels` | text corresponding to intervals in `ir`.
`x1` | if start positions are not integers, they can be set by `x1`.
`x2` | if end positions are not integers, they can be set by `x2`.
`gp` | graphic parameters for text. It should be specified by `gpar`.
`...` | pass to `grid.text`. E.g. you can set text justification by `just` here.

### Details

The text is added correspoding to the middle of each interval in `ir`.

### Value

A data frame which contains coordinates (in the 2D space) of text.

### Author(s)

Zuguang Gu <z.gu@dkfz.de>

### Examples

    hc = HilbertCurve(1, 100, level = 4, reference = TRUE)

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

    labels = sample(letters, length(ir), replace = TRUE)
    hc_text(hc, ir, labels = labels)

[Package HilbertCurve version 1.12.0 Index]