colplot function

Scatter plot, with variable-based point colours

Scatter plot, with variable-based point colours

colplot( x, y, z, n = 20, z.lim = NULL, breaks = NULL, palette = heat.colors, rev = TRUE, pch = 21, add = FALSE, ..., legend = FALSE, n.legend = 6, legend.pretty = TRUE, legend.plot = TRUE, legend.x, legend.y = NULL, legend.horiz = FALSE, legend.bg = par("bg") )

Arguments

  • x: a vector of x coordinates
  • y: a vector of y coordinates
  • z: a variable for defining colours
  • n: an integer giving the number of colour levels, supplied to pretty
  • z.lim: xxx
  • breaks: a vector or breaks for defining color intervals; defaults to NULL, so pretty and n are used on z
  • palette: a function for the color palette, or colors between breaks; defaults to heat.colors
  • rev: logical: should the palette be reversed? Defaults to TRUE
  • pch: an integer giving the plotting character, supplied to plot
  • add: should this be added to an existing plot? Defaults to FALSE
  • ...: other arguments passed to plot
  • legend: should a legend be added? Defaults to codeFALSE
  • n.legend: an integer giving the approximate number of legend entries; defaults to 6
  • legend.pretty: logical: should the legend values produced by [base]pretty? Othewrwise they are exact. Defaults to TRUE
  • legend.plot: passed to legend 's plot argument
  • legend.x: passed to legend 's x argument
  • legend.y: passed to legend 's y argument
  • legend.horiz: passed to legend 's horiz argument
  • legend.bg: passed to legend 's bg argument

Returns

A plot

Examples

x <- runif(50) y <- runif(50) colplot(x, y, x * y) colplot(x, y, x * y, legend=TRUE, legend.x="bottomleft") colplot(x, y, x * y, legend=TRUE, legend.pretty=FALSE, n.legend=10, legend.x="bottomleft", legend.horiz=TRUE)
  • Maintainer: Ben Youngman
  • License: GPL-3
  • Last published: 2022-06-28

Useful links