Learn R Programming

IDPmisc (version 0.3.1)

Image: Plots the Density of Points in Scatter Plot as Image

Description

The density of points in a scatter plot is encoded by color.

Usage

Image(x, y, pixs = 1, zmax = NULL, colramp = IDPcolorRamp)

Arguments

x, y
Coordinates of points whose density should be plotted.
pixs
Size of pixel in mm on the plotting device.
zmax
Maximum counts per Pixel to be plotted. When NULL the density in the scatter plot is encoded from 0/pixel to maximum/pixel found. zmax must be equal or larger than maximum counts found.
colramp
Color ramp to encode the density of the points within a pixel.

Value

  • Maximum number of counts per Pixel found.

Details

Before calling Image a plot must have been created by, for example, calling plot(x,y,type="n"). A similar solution for plotting densities is realized in the package fields: image.count. The main differences between the solution in IDPmisc and fields are the following: In Image the pixel size is defined in mm on the plotting device whereas in image.count the number of pixels in x- and y-direction are defined. Image works on ordinary plots whereas image.count needs the special plotting function image.plot.

See Also

ipairs, ilagplot, ixyplot, image, image.count

Examples

Run this code
x <- rnorm(10000)
y <- rnorm(10000,10)
plot(x+y,y,type="n")
Image(x+y,y)

Run the code above in your browser using DataLab