This function adds colored line segments to an existing plot. The line is plotted at points specified by inputs x and y, and colored according to factor input z (with one color for each level of z).
Usage
cline(x, y, z, color_vector)
Value
adds colored lines to a graph
Arguments
x
x positions of points to be plotted
y
y positions of points to be plotted
z
a factor, the same length as x and y. Line segments in the resulting plot will be colored according to the levels of z.
color_vector
a list of colors to use (length should match the number of levels in z).