[RQt-devel] one-sided glyph?

Yihui Xie xieyihui at gmail.com
Fri May 27 05:09:32 CEST 2011


Hi,

Is it possible to create a "one-sided" glyph? For example, a segment
glyph that goes from (0, 0) to (1, 0) and when we draw it with
qdrawGlyph(..., x, y), (0, 0) in the glyph corresponds to (x, y) in
the plot. Currently it seems the glyphs are always centered around (x,
y).

The example below uses qglyphSegment() in:
https://github.com/ggobi/qtpaint/blob/master/R/paintUtils.R#L45

library(qtbase)
library(qtpaint)
s = qscene()
r = qlayer(s)
r[1, 1] = qlayer(paintFun = function(layer, painter) {
    qdrawCircle(painter, .3, .3, r = 2)
    qdrawGlyph(painter, qglyphSegment(x = 20, symm = FALSE), .3, .3)
    qdrawCircle(painter, .5, .5, r = 2)
    qdrawGlyph(painter, qglyphSegment(x = 30, d = pi/2, symm = FALSE), .5, .5)
}, limits = qrect(matrix(c(0, 1, 0, 1), 2)))
print(qplotView(scene = s))


Thanks!

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


More information about the Qtinterfaces-devel mailing list