plot_points_3d: Function plot points in a 3d device window

View source: R/plot_points_3d.R

plot_points_3dR Documentation

Function plot points in a 3d device window

Description

Function plots the 3d points in the current device window. A data frame provides the x, y, and z location of the points. Options for point color and size along with labeling and axis options are provided.

Usage

plot_points_3d(
  df,
  x_col,
  y_col,
  z_col,
  group_col = NULL,
  win_width = 1000,
  win_height = 800,
  pt_colors = "black",
  pt_size = 6,
  pt_alpha = 1,
  bkg_color = "white",
  draw_axis = TRUE,
  main_title = NULL,
  x_lab = "X",
  y_lab = "Y",
  z_lab = "Z",
  axis_color = "black",
  xlim = c(0, 10),
  ylim = c(0, 10),
  zlim = c(0, 10),
  x_ticks = 11,
  y_ticks = 11,
  z_ticks = 11,
  html_file = NULL
)

Arguments

df

A data frame with columns for the x, y, and z locations and optionally a column for grouping the points.

x_col, y_col, z_col

Strings that set the columns names from df for the x, y, z numeric coordinates.

group_col

An optional string that sets the column name from df for grouping the points. The column must be a factor with discrete levels.

win_width, win_height

An integer defining the dimensions of the plot window.

pt_colors

Can be single string that sets the color for all the points. The default is "black". If group_col has been assigned then this parameter is a vector that sets the colors for each of factor column's levels.

pt_size

A numeric defining the size of all the points in pixels. The default is 6.0.

pt_alpha

A numeric between 0.0 and 1.0 that sets the alpha value for all the points. The default is 1.0.

bkg_color

A character string defining the window background color. The default is "white".

draw_axis

A logical which if TRUE draws the axes.

main_title

A character string defining the plot's main title.

x_lab, y_lab, z_lab

A character string defining the axis labels.

axis_color

A character string defining the axis color. The default is "black".

xlim, ylim, zlim

An integer vector defining the min/max of an axis.

x_ticks, y_ticks, z_ticks

An integer defining the number of ticks for an axis.

html_file

A character string that defines the file path for creating a WebGL version of the plot. File names should have an html extension.

Value

The device window id (an integer).


deandevl/RmatrixPkg documentation built on March 11, 2023, 2:39 a.m.