- structure(
- function(x = 0, y = 0, width = 1, height = 1, ...) {
- xlist <- c()
- ylist <- c()
- idlist <- c()
- if ("bottom" %in% type) { # bottom
- xlist <- append(xlist, c(x, x+width))
- ylist <- append(ylist, c(y, y))
- idlist <- append(idlist, c(1,1))
- }
- if ("top" %in% type) { # top
- xlist <- append(xlist, c(x, x+width))
- ylist <- append(ylist, c(y+height, y+height))
- idlist <- append(idlist, c(2,2))
- }
- if ("left" %in% type) { # left
- xlist <- append(xlist, c(x, x))
- ylist <- append(ylist, c(y, y+height))
- idlist <- append(idlist, c(3,3))
- }
- if ("right" %in% type) { # right
- xlist <- append(xlist, c(x+width, x+width))
- ylist <- append(ylist, c(y, y+height))
- idlist <- append(idlist, c(4,4))
- }
- polylineGrob(
- x=xlist, y=ylist, id=idlist, ..., default.units = "npc",
- gp=gpar(lwd=size, col=colour, lty=linetype),
- )
- },
+ structure(function(x = 0, y = 0, width = 1, height = 1, ...) {
+ xlist <- c()
+ ylist <- c()
+ idlist <- c()
+ if ("bottom" %in% type) { # bottom
+ xlist <- append(xlist, c(x, x+width))
+ ylist <- append(ylist, c(y, y))
+ idlist <- append(idlist, c(1,1))
+ }
+ if ("top" %in% type) { # top
+ xlist <- append(xlist, c(x, x+width))
+ ylist <- append(ylist, c(y+height, y+height))
+ idlist <- append(idlist, c(2,2))
+ }
+ if ("left" %in% type) { # left
+ xlist <- append(xlist, c(x, x))
+ ylist <- append(ylist, c(y, y+height))
+ idlist <- append(idlist, c(3,3))
+ }
+ if ("right" %in% type) { # right
+ xlist <- append(xlist, c(x+width, x+width))
+ ylist <- append(ylist, c(y, y+height))
+ idlist <- append(idlist, c(4,4))
+ }
+ polylineGrob(x=xlist, y=ylist, id=idlist, ..., default.units = "npc",
+ gp=gpar(lwd=size, col=colour, lty=linetype),
+ )
+ },