Learn R Programming

pracma (version 1.4.5)

pltcross: Plotting Crosses

Description

Plots crosses into an active graphics device.

Usage

pltcross(x, y, cx = 0, cy = 0,
         clen = 0.1, cent = FALSE, color = "darkgrey", ...)

Arguments

x, y
x- and y-coordinates of points.
cx, cy
x- and y-coordinates of ceter points of crosses.
clen
length of crosses in proportion of displayed coordinates, i.e. the min and max values of x and y.
cent
logical; if true an additional point will be plotted at the center of the cross.
color
color to be used for the lines of the crosses.
...
additional plotting argument to be passed to the lines function.

Value

  • No value returned.

Details

Plots one or a series of crosses into the active graphics window without erasing the existing content.

The range of x and y is assumed to represent the upper and lower values of the coordinate axes. The length of the lines of the cross is then computed as clen*range where clen has to have values between 0 and 1.

If cent is true, points will have the same color as its crosses. The point shape is the usual circle and cannot be changed at the moment.

See Also

symbol

Examples

Run this code
plot(c(0,1), c(0,1), type = "n")
xc <- runif(200); yc <- runif(200)
clen <- pmin(xc, 1-xc, yc, 1-yc)
clr <- 1:8
plot(xc, yc, col=clr)
pltcross(c(0,1), c(0,1), xc, yc, clen = clen, color = clr)

Run the code above in your browser using DataLab