kh3_plot: Plot xyz tibble in rgl

Description Usage Arguments Details Examples

Description

kh3_plot is the main kh3d plotting function.

Usage

1
2
3
4
5
kh3_plot(data, color = "#084082ff", style = c("surface", "points",
  "lines"), line_overlay = TRUE, show_ticks = TRUE, aspect = c(8, 2,
  1), xlab = "", ylab = "", zlab = "", plot_bg = rgb(0.3, 0.3,
  0.3), shininess = 3, theta = 0, phi = -80, zoom = 1.03,
  fov = 60)

Arguments

data

tibble with 3 columns (x, y, z), the data to be plotted.

color

color value, plotting color.

style

string ('surface', 'points', 'lines'), plotting style.

line_overlay

logical scalar, should lines be drawn ontop the 3d surface?

aspect

numeric vector of length 3, defining the plot aspect ratio.

xlab

sting scalar, the x axis label.

ylab

sting scalar, the y axis label.

zlab

sting scalar, the z axis label.

shininess

numeric scalar, shininess of the plotting surface.

Details

Main plotting function of kh3d.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n_steps <- 31
data <- tibble(x = 2*pi*(1:n_steps)/n_steps,
               y = x) %>%
  purrr::cross_df() %>%
  mutate( z = sin(x)*sin(y))

data %>% kh3_plot(., color = kh_clr[2],
                 xlab = 'x test',
                 ylab = 'y test',
                 zlab = 'z test',
                 aspect = c(2,3,1.3),
                 style = 'surface',
                 shininess = 4)

k-hench/kh3d documentation built on July 8, 2019, 3:33 a.m.