barbedGrob: barbedGrob

Description Usage Arguments Value See Also Examples

View source: R/barbedGrob.r

Description

plot lines and symbols

Usage

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

Arguments

x

coordinates

y

coordinates

size

unit vector for the symbols

pch

vector of symbol types

space

numeric scaling factor for the exclusion zone

only.lines

logical: should only split lines be returned?

arrow

arrow passed to grid.segments

gp

gpar() object for the symbols

name

grob name

default.units

default units

vp

viewport

Value

a grob

See Also

grid.segments, grid.points

Other grob userlevel: arcTextGrob, borderGrob, colorstripGrob, ebimageGrob, ellipseGrob, interleaven, ngonGrob, patternGrob, pixmapGrob, rpatternGrob, stextGrob, tableGrob, virtualGrob

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
set.seed(1234)
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)

ttriche/oldGridExtra documentation built on May 27, 2017, 4:47 p.m.