gridExtra (version 0.9.1)

barbedGrob: barbedGrob

Description

plot lines and symbols

Usage

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

Run this code
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)

Run the code above in your browser using DataLab