Description Usage Arguments Value Examples
View source: R/sbpiper_plots.r
Plot a scatter plot using a coloured palette
1 2 3 | scatterplot_w_colour(df, g = ggplot(), colNameX = "x", colNameY = "y",
colNameColor = "colour", dot_size = 1,
colours = colorRamps::matlab.like(256), limits = NULL)
|
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) |
the plot
1 2 | df <- data.frame(a=rnorm(10000), b=rnorm(10000), c=rev(seq(10000)))
scatterplot_w_colour(df, colNameX="a", colNameY="b", colNameColor="c")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.