saveView: Help function to save the view angle for the RGL 3D plot

View source: R/plot.R

saveViewR Documentation

Help function to save the view angle for the RGL 3D plot

Description

Help function to save the view angle for the RGL 3D plot

Usage

saveView(fname = "view.RData", overwrite = FALSE, print = FALSE)

Arguments

fname

The file name of the view.

overwrite

Overwrite existing file.

print

Print the view so can be copied to R code (no file is saved).

Value

NULL (invisible).

Note

Only save if the file name don't exists.

Author(s)

Lars Relund lars@relund.dk

Examples


view <- matrix( c(-0.412063330411911, -0.228006735444069, 0.882166087627411, 0,
0.910147845745087, -0.0574885793030262, 0.410274744033813, 0, -0.042830865830183,
0.97196090221405, 0.231208890676498, 0, 0, 0, 0, 1), nc = 4)

loadView(v = view)
A <- matrix( c(3, 2, 5, 2, 1, 1, 1, 1, 3, 5, 2, 4), nc = 3, byrow = TRUE)
b <- c(55, 26, 30, 57)
obj <- c(20, 10, 15)
plotPolytope(A, b, plotOptimum = TRUE, obj = obj, labels = "coord")

# Try to modify the angle in the RGL window
saveView(print = TRUE)  # get the view angle to insert into R code


relund/gMOIP documentation built on Feb. 23, 2024, 12:11 p.m.