gg3d_scatterplot: Produce a 3D scatterplot in ggplot format

View source: R/main.R

gg3d_scatterplotR Documentation

Produce a 3D scatterplot in ggplot format

Description

Produce a 3D scatterplot in ggplot format.

Usage

gg3d_scatterplot(
  x,
  y,
  z,
  colour = 1,
  size = 0.5,
  theta = 135,
  phi = 30,
  d = 2,
  x_lim = NULL,
  y_lim = NULL,
  z_lim = NULL,
  x_grid = NULL,
  y_grid = NULL,
  z_grid = NULL,
  z_type = 2,
  flip_grid_x = FALSE,
  flip_grid_y = FALSE,
  grid_col = grey(0.8),
  grid_size = 0.25,
  zero_line_on = TRUE,
  zero_line_col = grey(0.8),
  zero_line_size = 0.6,
  axis_on = FALSE,
  axis_col = "black",
  axis_size = 0.5,
  x_lab = "x",
  y_lab = "y",
  z_lab = "z",
  tick_length = 0.2,
  axis_lab_size = 3,
  axis_lab_dist = 2
)

Arguments

x, y, z

vectors giving coordinates of points.

colour

vector specifying point colours. Can be continuous or discrete.

size

size of data points.

theta

angle of rotation (degrees).

phi

angle of elevation (degrees).

d

strength of perspective transformation.

x_lim, y_lim, z_lim

plotting limits.

x_grid, y_grid, z_grid

sequences of breaks defining grid.

z_type

switch between horizontal grid in the z-dimension (z_type = 1) and both horizontal and vertical grid (z_type = 2).

flip_grid_x, flip_grid_y

if TRUE then the vertical grid in the x- or y-axis is moved to the other side of the plot.

grid_col

the colour of grid lines.

grid_size

the size of grid lines.

zero_line_on

whether to draw lines at zero in every dimension.

zero_line_col

the colour of zero lines.

zero_line_size

the size of zero lines.

axis_on

whether to draw axis lines.

axis_col

the colour of axis lines.

axis_size

the size of axis lines.

x_lab, y_lab, z_lab

axis labels.

tick_length

the absolute length of axis ticks.

axis_lab_size

the size of axis labels.

axis_lab_dist

the absolute distance of axis labels from the edge of the plotting region.


bobverity/bobfunctions2 documentation built on July 4, 2023, 8:55 p.m.