segments: Segments

Description Usage Arguments Value Examples

Description

Front end to the graphics::segments function allowing simplified specification of end points

Usage

1
2
3
4
5
6
7
segments(x0, y0, ...)

## S4 method for signature 'xy,xy'
segments(x0, y0, ...)

## S4 method for signature 'xy,missing'
segments(x0, y0, ..., circular = FALSE)

Arguments

x0, y0

two numeric vectors of a single object of class "xy"

...

additional arguments passed on to graphics::segments

circular

logical: should the line link up with the initial point? (Single location argument only.)

x1, y1

two numeric vectors of a single object of class "xy"

Value

invisible null value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
nam <- c("mai", "mar", "pin", "plt", "usr", "xaxp", "yaxp", "bg")
oldPar <- par(nam)
par(mar = c(4,4,1,1)+0.1, bg = alpha("sky blue", 0.25))
z <- with(roundTrip, setNames(complex(real = Longitude, imaginary = Latitude), Locality))
plot(z, asp = 1, pch = 20, cex = 0.7, bty = "n", cex.axis = 0.8,
  xlab = "Longitude", ylab = "Latitude", ylim = -c(50,5))
lines(Oz, col = alpha("dark green", 0.5))
text(z, labels = names(z), pos = avoid(z), cex = 0.7)
segments(z, cyc(z), col = "red")
if(lazyData::requireData(PBSmapping)) {
  plotPolys(worldLLhigh, xlim = c(110, 155), ylim = c(-45, -9),
    col = alpha("sandy brown", 0.5), projection = "LL", axes = FALSE,
    border = alpha("navy", 0.25), xlab = "", ylab = "", bty = "n")
  axis(2, at = 10*(-4:-1), cex.axis = 0.7, line = 2)
  axis(1, at = 10*(12:15), cex.axis = 0.7, line = 2)
  points(z, pch = 20, cex = 0.7)
  text(z, labels = names(z), pos = avoid(z), cex = 0.7)
  segments(z, cyc(z), col = "red")
}
  par(oldPar)

BillVenables/WWRGraphics documentation built on Feb. 1, 2021, 12:13 p.m.