ggscatter | R Documentation |
ggplot2-based scatterplot
ggscatter( data, x_colname, y_colname, group_var = NULL, title = NULL, subtitle = NULL, x_title = NULL, y_title = NULL, point_size = 2, point_shape = 21, point_alpha = 0.75, point_color = "gray30", point_fill = "gray30", palette = "Paired", equal_axes = F, diag = F )
data |
A data frame or matrix with columns of interest for plotting. |
x_colname |
A string for the column variable to assign to the x-axis of the plot. |
y_colname |
A string for the column variable to assign to the y-axis of the plot. |
group_var |
A string or vector of strings for the grouping variable(s) to use from
|
title |
A string for the plot title. |
subtitle |
A string for the plot subtitle. |
x_title |
A string for the x-axis title. |
y_title |
A string for the y-axis title. |
point_size |
A numeric for the plot point size. |
point_shape |
A numeric for the plot point shape. |
point_alpha |
A numeric for the plot point alpha level. |
point_color |
A string for plot point color. Only used when |
point_fill |
A string for the plot point fill color. Only used when |
palette |
A string for the RColorBrewer palette name to use when |
equal_axes |
A logical. Should the scatterplot use the same axis limits for both axes? |
diag |
A boolean denoting whether to include a 45-degree line through the origin. |
A ggplot2 object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.