barbedGrob: barbedGrob

Description Usage Arguments Value See Also Examples

View source: R/barbedGrob.r

Description

plot lines and symbols

Usage

1
2
3
4
barbedGrob(x=stats::runif(10), y=stats::runif(10),
    size=unit(sample(1:4, 10, repl = TRUE), "char"),
    pch=21, space=1, only.lines=FALSE, gp=gpar(), name,
    default.units="npc", vp)

Arguments

x

coordinates

y

coordinates

size

unit vector for the symbols

pch

vector of symbol types

space

numeric scaling factor for the exclusion zone (see Details)

only.lines

logical: should only split lines be returned?

gp

gpar() object for the symbols

name

grob name

default.units

default units

vp

viewport

Value

a grob

See Also

grid.segments, grid.points

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
grid.barbed(name="test")
grid.edit("test", gp=gpar(fill="blue", lwd=3))
grid.edit("test::points", pch=22)
grid.newpage()
g <- 
barbedGrob(size=unit(1:5, "char"), only=FALSE, 
gp=gpar(col="red", lex=3, fill="blue", alpha=0.5, pch=3))

pushViewport(vp=viewport(width=1, height=1))
grid.rect(gp=gpar(fill="thistle2"))
grid.grill(gp=gpar(col="lavenderblush1", lwd=3, lty=3))
grid.draw(g)
x <- c(0.2, 0.7)
y <- x
dev.new(width=3, height=7) 
grid.newpage()
g <- 
barbedGrob(x, y, size=unit(c(2, 10), "mm"))
pushViewport(vp=viewport(width=1, height=1))
grid.draw(g)
grid.points(x, y, pch=3)

gridExtra documentation built on May 2, 2019, 4:59 p.m.