Format S graphics so Spotfire can display it.

makePNGBlob

Description

Make a graphic in PNG format and make a "raw" object out of it that Spotfire can use to display the graphic in a label control.

Usage

makePNGBlob(expr, width = 480, height = 480)
    

Arguments

expr An expression (inluding a group of expressions in braces) that produces a graphic. This should not include any call that turns a graphics device on or off, just the calls to produce a plot. The generated plot should consist of a single page.
width An integer giving the width of the graphic in pixels.
height An integer giving the height of the graphic in pixels.

Value

A vector of class "raw" containing the bytes of a portable network graphics file. This may be stored as a Spotfire document property and displayed as a graphic when used as the data in a Label control in a Text Area pane.

Examples

graphicsBlob <- makePNGBlob({
    x <- sort(runif(30))
    plot(x)
}, width = 500, height = 450)
# Send graphicsBlob back to Spotfire as a document property and
# put it into a Label control in a Text Area.