ggscatter: ggplot2-based scatterplot

View source: R/plot_utils.R

ggscatterR Documentation

ggplot2-based scatterplot

Description

ggplot2-based scatterplot

Usage

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
)

Arguments

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 data to color points. If multiple variables are specified, they are combined into a single string to make a single new variable.

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 group_var is NULL.

point_fill

A string for the plot point fill color. Only used when group_var is NULL.

palette

A string for the RColorBrewer palette name to use when group_var is specified.

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.

Value

A ggplot2 object.


bryancquach/omixjutsu documentation built on Jan. 29, 2023, 3:47 p.m.