rgl2bitmap: Save currently active rgl 3D graph to bitmap format

View source: R/rgl2bitmap.R

rgl2bitmapR Documentation

Save currently active rgl 3D graph to bitmap format

Description

Save currently active rgl 3D graph to bitmap format in current orientation

Usage

rgl2bitmap(file = "Rplot", type = c("PNG"))

rgl2png(...)

Arguments

file

name of output file. Any extension is ignored and added according to the requested output type. If file already exists it is overwritten.

type

desired output type - currently only PNG is supported.

...

passing the rgl2png arguments to rgl2bitmap

Value

No return value

Functions

  • rgl2png(): Save currently active rgl 3D graph to PNG format

Author(s)

Tom Wenseleers

Examples

# Create a file name
filen <- tempfile(pattern = "rgl") # or 
# filen <- paste("YOUR_DIR/rgl")

# Generate a 3D plot using 'rgl'
x = y = seq(-10, 10, length = 20)
z = outer(x, y, function(x, y) x^2 + y^2)
rgl::persp3d(x, y, z, col = 'lightblue')

# Save the plot as a png
rgl2png(file = filen)
# Note that omitting 'file' will save in current directory

export documentation built on Dec. 7, 2022, 5:13 p.m.