figaro {GCDkit}R Documentation

Create a new figaro drawing object

Description

A figaro drawing object is created with methods for assigning data and for modifying many of the important graphical attributes.

Usage

figaro(name, prefix="fss")

Arguments

name

the name of an R function that creates a graphic figure, or the name of a figure definition from a figaro stylesheet, unquoted

prefix

quoted name of a figaro stylesheet, default is "pss"

Details

Once created and data assigned to the figaro drawing object, one can zoom/unzoom on the data and change attributes such as colour, symbol, and titles. The output drawing can be recreated on any R graphical device by a simple method call on the object. Individual custom changes to the drawing are automatically preserved. Figaro drawing objects can also be saved and restored in the default workspace or by using dump,save and load.

Value

The function returns a figaro drawing object with methods (functions) for creating and modifying the drawing.

draw(...)

the draw() method assigns data to the figaro drawing object. The arguments are exactly as required by the graphic function used when the figure object is created. The data is drawn on the current graphical device. Used without any arguments draw will redraw the drawing on the current device. This way drawing objects can be created, saved and redrawn without needing to match the data and the function as required by conventional R graphics.

set(...)

set() is used to change graphical attributes or characteristics of the drawing. Two argument forms are possible. The simplest is a list of attribute.name=

value pairs, eg, set(main="Main Title", sub="subheading"). If used in conjunction with a figaro style sheet, then to change attributes of elements of the stylesheet the name of the stylesheet graphic element must be given as the first argument, eg. set("txt1", font=3) to change the font of the txt1 element of the diagram. Any changes made are automatically stored and the figure redrawn.

zoom()

zoom() requires the user to pick two coordinates with the pointing device at opposite corners of the area of the drawing of interest. The figure will be redrawn using these coordinates to from the bounding box of the plot. Multiple calls to zoom() are permitted.

unzoom()

unzoom() will restore the drawing to view all the data as displayed before any zoom() calls.

legend()

The legend function will allow the placement under user control of a legend. The location of the bottom left corner of the legend should be selected with the pointing device. legend() requires a graphic data object, describing the data and labels to use, see as.go. For example see FIGARO.

show()

show() is a debugging aid for displaying the data in the figaro object

Note

If in doubt look in the source code.

Author(s)

Colin Farrow (c.farrow@compserv.gla.ac.uk)

References

Full details are available on the Figaro web site

See Also

For an overview of figaro see FIGARO, graphical data objects, see as.go. Also par for details of graphical parameters that may be changed to customize a drawing, but note that some graphical parameters (those concerning layout etc ) are intended for use in the underlying graphical function rather than in a figaro graphic.

Examples

# create a new figure object
p <- figaro(plot)
# plot some data
p$draw(runif(10), runif(10))
# change the main title
p$set(main="Figaro Demonstration")
# and take a closer look
p$zoom() 
# then use the pointer to select two points at opposite corners 
# of the area of interest

# a histogram
h <- figaro(hist)
h$draw(rnorm(2000), col="blue")
# .. a better colour
h$set(col="yellow")

# save as postscript
postscript(file="example_plots")
p$draw()
h$draw()
dev.off()

[Package GCDkit version 3.00 Index]