Learn R Programming

IDPmisc (version 0.3.1)

ixyplot: Image Scatter Plot for Large Datasets

Description

Produces an image scatter plot of large datasets where the colors encode the density of the points in the scatter plot. Works also with factors.

Usage

ixyplot(x, y = NULL,
        pixs = 1, zmax = NULL, colramp = IDPcolorRamp, border = FALSE,
        xlab = NULL, ylab = NULL, nx.lab = 5, ny.lab = 5,
        main = NULL, cex.main = par("cex.main"))

Arguments

x
Object of dimension (n,1) or (n,2) when y not present. \crVectorof length(n) when y present.
y
Vector of length n or NULL.
pixs
Pixelsize in mm.
zmax
Maximum counts per pixel to be plotted. zmax must be >= maximum number of counts per pixel.
colramp
Color ramp to encode the density of the points within a pixel.
border
Shall border be drawn between the colors in the legend: TRUE / FALSE.
xlab
Label for x-axis.
ylab
Label for y-axis.
nx.lab
Approximate number of labeled ticks on x-axis.
ny.lab
Approximate number of labeled ticks on y-axis.
main
Title.
cex.main
Size of title relative to par("cex")

Value

  • Maximum number of counts per Pixel found.

concept

  • large dataset
  • huge dataset

Details

The idea is similar to plot.hexbin. The hexagons are better suited to reflect the density of points in a plane than the squares used here. Nevertheless squares are, contrary to hexagons, invariant to reflexions at the x- and y-axis and therefore suited for scatter plot matrices and also for plotting factors.

See Also

ilagplot, ipairs, Image

Examples

Run this code
x <-  rnorm(100000)
y <- atan(rnorm(100000,0))
ixyplot(x,y)
ixyplot(x,pixs=2)
ixyplot(iris[,1:2],pixs=4)
ixyplot(iris[,"Petal.Width"],iris[,"Species"],pixs=4)
ixyplot(x=iris[,"Species"],y=iris[,"Petal.Width"],pixs=4,border=TRUE,
        xlab="Species",
        ylab="Petal Width",
        main="Iris Species and Petal Width")

Run the code above in your browser using DataLab