compose_close {ursa} | R Documentation |
Finish plotting
Description
Function compose_close
does followed tasks: 1) completes all unfinsished actions before shutting down graphical device, 2) cuts extra margins, and 3) opens resulted PNG file in the associated viewer.
Usage
compose_close(...)
## non-public
.compose_close(kind = c("crop2", "crop", "nocrop"),
border = 5, bpp = 0, execute = TRUE, verbose = FALSE)
Arguments
... |
Set of arguments, which are recognized via their names and classes, and then passed to
| ||||||||||||
kind |
Character keyword for cutting of excess white spaces. If | ||||||||||||
border |
Non-negative integer. Number of pixels for margins, which are not cropped. Default is | ||||||||||||
bpp |
Integer. Bits per pixel for output PNG file. Valid values are | ||||||||||||
execute |
Logical. Should created PNG file be opened in the associated external program for viewing graphical files? Default is | ||||||||||||
verbose |
Logical. Value |
Details
The cut manipulations (crop="crop"
or crop="crop2"
) are implemented using readPNG
and writePNG
functions of package png. These fuctions have limitations in the memory allocation.
Function compose_close
clears all internal graphical options, specified during compose_open
executing.
Some parameters are specified in compose_open
: weather output PNG file will be removed after opening (logical delafter
), or what is the time of waiting for file opening and next removing (numerical wait
in seconds).
Value
Function returns NULL
value.
Warning
Currenty, execute=TRUE
is implemented for Windows platform only using construction R CMD open \emph{fileout}
.
Author(s)
Nikita Platonov platonov@sevin.ru
Examples
session_grid(NULL)
a <- ursa_dummy(nband=6,min=0,max=255,mul=1/4)
## exam 1
compose_open()
compose_close()
## exam 2
compose_open(a)
compose_close()
## exam 3
compose_open("rgb",fileout="tmp1")
compose_plot(a[1:3])
compose_close(execute=FALSE)
Sys.sleep(1)
a <- dir(pattern="tmp1.png")
print(a)
file.remove(a)