topoScatter: Topographical scatterplot

View source: R/yogitools.R

topoScatterR Documentation

Topographical scatterplot

Description

Draw a 'topographical scatterplot' or 'scatter-heatmap'

Usage

topoScatter(
  x,
  y,
  resolution = 20,
  thresh = 5,
  topoCol = colorRampPalette(c("black", "red", "yellow"))(20),
  maxFreq = NULL,
  xlim = range(x, na.rm = TRUE),
  ylim = range(y, na.rm = TRUE),
  log = "",
  ...
)

Arguments

x

a vector of x-coordinates

y

a vector of y-coordinates (must match x in length)

resolution

the resolution of the plot, that is into how many bins each axis will be sub-divided. Defaults to 20.

thresh

a threshold of how many data points must fall into a bin before it they replaced with a density-indicating color

topoCol

a vector of colors defining a color gradient to use for the density map

xlim

the x-axis range (see plot()).

ylim

the y-axis range (see plot()).

log

As in plot(). "x" draws the x-axis in log scale, "y" draws the y-axis in log-scale, "xy" draws both in log scale, "" draws both linearly.

Examples

x <- rnorm(10000,0,1)+10
y <- rnorm(10000,0,1)+10
topoScatter(x,y,resolution=60,xlab="foo",ylab="bar",thresh=2)
topoScatter(x,y,log="xy",resolution=60,xlab="foo",ylab="bar")


jweile/yogitools documentation built on May 11, 2023, 7:42 p.m.