heatscatterpoints: A colored scatterplot based on a two-dimensional Kernel...

Description Usage Arguments Note Author(s) References See Also Examples

View source: R/LSD.heatscatter.R

Description

Visualize two dimensional data in a three dimensional fashion facilitating a color encoded Kernel Density Estimation (add to an existing plot).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
heatscatterpoints(
  x,
  y,
  pch = 19,
  cexplot = 0.5,
  nrcol = 30,
  grid = 100,
  colpal = "heat",
  simulate = FALSE,
  daltonize = FALSE,
  cvd = "p",
  alpha = NULL,
  rev = FALSE,
  xlim = NULL,
  ylim = NULL,
  only = "none",
  add.contour = FALSE,
  nlevels = 10,
  color.contour = "black",
  greyscale = FALSE,
  log = "",
  ...
)

Arguments

x

a numeric vector.

y

a numeric vector.

pch

plotting 'character'. This can either be a single character or an integer code for one of a set of graphics symbols. (see '?pch', to be passed to plot).

cexplot

a numerical value giving the amount by which the points should be magnified relative to the default.

nrcol

a non-negative integer specifying the number of colors to be used (defaults to 100, if not specified).

grid

an integer specifying the size of the grid used for the KDE.

colpal

a character vector containing R built-in color names or a name of a LSD colorpalette as a character string (see disco() or disco) (defaults to "heat", if not specified).

simulate

logical: if TRUE (FALSE by default), a converted colorpalette is used to simulate dichromat vision according to http://www.daltonize.org (see daltonize).

daltonize

logical: if TRUE (FALSE by default), a converted colorpalette is used to enhance dichromat vision according to http://www.daltonize.org (see daltonize).

cvd

character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope).

alpha

alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default).

rev

logical: if TRUE (FALSE by default), a reversed colorpalette is used.

xlim

x limits, standard graphics parameter.

ylim

y limits, standard graphics parameter.

only

a character string which contains 'x' if the density should only be computed for the x axis, 'y' for the y axis (defaults to 'none' for the two-dimensional case).

add.contour

logical: if TRUE (FALSE by default), the contour lines are added to the plot.

nlevels

an integer giving the number of levels of the contour lines.

color.contour

R build-in color for the contour lines.

greyscale

logical: if TRUE (FALSE by default), the used colorpalette is converted to greyscales.

log

a character string which contains "x" if the x axis is to be logarithmic, "y" if the y axis is to be logarithmic and "xy" or "yx" if both axes are to be logarithmic.

...

additional parameters to be passed to points and plot.

Note

Two-Dimensional Kernel Density Estimation adapted and modified from Venables and Ripley's MASS package (see reference).

Author(s)

Bjoern Schwalb

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See Also

comparisonplot, demotour, disco, colorpalette

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
points = 10^4
x = c(rnorm(points/2),rnorm(points/2)+4)
y = x + rnorm(points,sd=0.8)
x = sign(x)*abs(x)^1.3

plot.new()
plot.window(xlim = c(-5,15),ylim = c(-4,8))
heatscatterpoints(x,y,add.contour=TRUE,color.contour="green",greyscale=TRUE)
axis(1)
axis(2)
box()

Example output



LSD documentation built on July 2, 2020, 4:14 a.m.

Related to heatscatterpoints in LSD...