hc_text-HilbertCurve-method | R Documentation |
Add text to Hilbert curve
## S4 method for signature 'HilbertCurve'
hc_text(object, ir = NULL, labels, x1 = NULL, x2 = x1, gp = gpar(),
centered_by = c("interval", "polygon"), ...)
object |
A |
ir |
an |
labels |
text corresponding to intervals in |
x1 |
if start positions are not integers, they can be set by |
x2 |
if end positions are not integers, they can be set by |
gp |
graphic parameters for text. It should be specified by |
centered_by |
how to define the "center" of the interval represented in Hilbert curve. See Details section. |
... |
pass to |
If centered_by == "interval"
, the text is added correspoding to the middle of each interval in ir
,
while if centered_by == "polygon"
, the text is put in the visual center of the polygon of the interval
in the Hilbert curve.
A data frame which contains coordinates (in the 2D space) of text.
Zuguang Gu <z.gu@dkfz.de>
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.