Learn R Programming

sbpiper (version 1.9.0)

scatterplot_w_colour: Plot a scatter plot using a coloured palette

Description

Plot a scatter plot using a coloured palette

Usage

scatterplot_w_colour(df, g = ggplot(), colNameX = "x", colNameY = "y",
  colNameColor = "colour", dot_size = 1,
  colours = colorRamps::matlab.like(256), limits = NULL)

Arguments

df

a data frame

g

the current ggplot to overlap

colNameX

the name of the column for the X axis

colNameY

the name of the column for the Y axis

colNameColor

the name of the column whose values are used as 3rd dimension

dot_size

the size of the dots in the scatterplot

colours

the palette to use

limits

the limits for the palette (NULL if no limit is used)

Value

the plot

Examples

Run this code
# NOT RUN {
df <- data.frame(a=rnorm(10000), b=rnorm(10000), c=rev(seq(10000)))
scatterplot_w_colour(df, colNameX="a", colNameY="b", colNameColor="c")
# }

Run the code above in your browser using DataLab