scatter_heatmap: Scatter Heat Map

Description Usage Arguments Value Examples

View source: R/scatter_heatmap.R

Description

Function to plot a scatter plot where each point is coloured by its 2-dimensional density.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
scatter_heatmap(
  xvalues,
  yvalues,
  xlabel = "x",
  ylabel = "y",
  xlim = NULL,
  ylim = NULL,
  alphaval = 1,
  colourPal = "inferno",
  suckInVals = T
)

Arguments

xvalues

X values

yvalues

Y values

xlabel

X axis label

ylabel

Y axis label

xlim

Vector including limits of the x axis

ylim

Vector including limits of the x axis

alphaval

The transparency of the points

colourPal

The colour palette name from viridis to use - default is Inferno

suckInVals

Points beyond the limits will be sucked in to the edge values to depict that there exists more beyond the edge of the plot. Default is TRUE.

Value

Returns the ggplot2 plot

Examples

1
2
3
4
x = rnorm(n = 50000, mean = 2, sd = 1)
y = rexp(50000, 1)

scatter_heatmap(x, y, 'X Values', 'Y Values', c(0, 3.5), c(-0.1, 8), 1 , 'viridis')

mathesong/granviller documentation built on April 20, 2020, 7:28 p.m.