snap: Take a snapshot of the current 3D plot

View source: R/snap.R

snapR Documentation

Take a snapshot of the current 3D plot

Description

snap is designed as a more convenient interface to rgl.snapshot, allowing one to set a base filename for graphic output files, an initial sequence number, and then just use

snap()

to capture the current screen image to a sequentially numbered output file.

Usage

snap(n = 0, fn = "Movie" ,  suffix = "", inc = TRUE, fmt = "png")

Arguments

n

Initial suffix number used to construct the file name.

suffix

Character string appended to paste(fn, n), for use in naming a related collection of figures (without incrementing n.

fn

Base file name with rgl.cur() appended. Can be set with Plot3d.par(snap.fn="File").

inc

Should the function increment the sequential number in the global environment?

fmt

Output graphic file format. Default: png

Details

Output files are written to the current directory. Use fn to put them in a sub-directory.

Value

Returns invisibly the name of the snapshot file

Author(s)

Georges Monette

See Also

rgl.snapshot

Examples

## Not run: 

# ... generate an rgl graph ...
# In a rgl window in which 'snap' has not been invoked:
snap()
# ... will invoke rgl.snapshot which filename 'Movie10000.png' and increment
# snap.n to '0001' 

## End(Not run)


gmonette/p3d documentation built on Nov. 16, 2023, 11:31 p.m.