plot_lines_3d: Function plots line segments in a 3d device window

View source: R/plot_lines_3d.R

plot_lines_3dR Documentation

Function plots line segments in a 3d device window

Description

Function plots a collection of line segments where segments is a numeric matrix of six columns of start and end points in 3d space. Options are provided for sizing the device window, width/color of the segments, and defining/labeling axis,

Usage

plot_lines_3d(
  segments,
  win_width = 1000,
  win_height = 800,
  segment_colors = NULL,
  segment_widths = NULL,
  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

segments

A numeric matrix where each row is a line segment defined by a pair of points in 3d space. The first three columns defines the x/y/z coordinates for the first point; the next three columns define the second point of the segment.

win_width, win_height

An integer defining the dimensions of the plot window.

segment_colors

A vector of strings defining each segment's color. The default is "black". The length of segment_colors should be the same as segments.

segment_widths

A numeric vector defining each segment's width. The default is 1.0. The length of segment_widths should be the same as segments.

bkg_color

A character string defining the window background color.

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.

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.