Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

clplot

Plot lines with colors determined by values.


Description

clplot displays a plot of lines for which the colors are dependent upon the x and y values. clplot is similar to color.scale.lines except that while the latter calculates a color for each unique value, clplot assigns colors to groups of values within the cutpoints defined by levels.

Usage

clplot(x,y,ylab=deparse(substitute(y)),xlab=deparse(substitute(x)),
  levels=seq(min(y)+(max(y)-min(y))/5,max(y)-(max(y)-min(y))/5,length.out=4),
  cols=c("black","blue","green","orange","red"),lty=1,showcuts=FALSE,...)

Arguments

x,y

numeric data vectors.

ylab,xlab

Labels for the X and Y axes.

levels

Cut points to assign colors to the values of x and y.

cols

The colors to be assigned.

lty

The line type.

showcuts

Whether to show the positions of the cut points.

...

additional arguments passed to plot or lines.

Value

nil

Author(s)

Carl Witthoft

See Also

Examples

x<-seq(1,100)
 y<-sin(x/5)+x/20
 clplot(x,y,main="Test of clplot")

plotrix

Various Plotting Functions

v3.8-1
GPL (>= 2)
Authors
Jim Lemon, Ben Bolker, Sander Oom, Eduardo Klein, Barry Rowlingson, Hadley Wickham, Anupam Tyagi, Olivier Eterradossi, Gabor Grothendieck, Michael Toews, John Kane, Rolf Turner, Carl Witthoft, Julian Stander, Thomas Petzoldt, Remko Duursma, Elisa Biancotto, Ofir Levy, Christophe Dutang, Peter Solymos, Robby Engelmann, Michael Hecker, Felix Steinbeck, Hans Borchers, Henrik Singmann, Ted Toal, Derek Ogle, Darshan Baral, Ulrike Groemping, Bill Venables
Initial release
2021-01-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.