scatterplot.RdCreate a scatterplot using the magma color scheme
scatterplot(
df,
x,
y,
c = NULL,
t = "",
o = 0.5,
s = 3,
xtitle = "",
ytitle = "",
ctitle = "",
xzero = FALSE,
yzero = FALSE,
shapes = FALSE
)A dataframe to use for the scatterplot.
Column-name of the numerical or categorical variable to be plotted on the x-axis
Column-name of the numerical or categorical variable to be plotted on the y-axis
Column-name of the categorical variable to color-code the data points Default value is blank for cases when there is no categorical column
Title of the plot. Default value is blank. If not provided, title will be computed based on x, y and/or c
Opacity of the data points. Number between 0.1 and 1.0 (inclusive)
Size of the data points. Number between 1 and 5 (inclusive)
Title of the x-axis. Default value is blank. If not provided, title will be proper case of the x axis column
Title of the x-axis. Default value is blank. If not provided, title will be proper case of the y axis column
Title of the x-axis. Default value is blank. If not provided, title will be proper case of the color column
Scale the x-axis to start from 0 by specifying TRUE Default value is set to FALSE
Scale the x-axis to start from 0 by specifying TRUE Default value is set to FALSE
Assign the color column to the shape attribute of the plot if TRUE Default value is set to FALSE
A ggplot object.
penguins_data <- palmerpenguins::penguins
scatterplot(penguins_data, bill_length_mm, flipper_length_mm, species,
"Bill and Flipper length clusters by Species",
0.5, 2.5, "Bill length (mm)", "Flipper length (mm)", "", FALSE, FALSE, TRUE)
#> Warning: Removed 2 rows containing missing values (geom_point).