panel {RGrace}R Documentation

Axes and its elements

Description

A function defined in R-environment of class "figure" ("method" of "figure" object). fig$panel() creates new axes (i.e. tick's marks and labels, axes titles for left, bottom, right and top axes and bounding box) in the plotting area of figure fig.

Arguments

x,y location of axes in respect to parent figure's cell grid (see figure). Position specification is integer vector with first element - bottom,left corner position and the second - extent in the horizontal/vertical direction.
scale.X,scale.Y Minimum/maximum values of X and Y axes in native (i.e. data) units (see unit)
xticks,yticks Character vector with two components describing axis's ticks positions and ticks labels. First component is related to bottom X/left Y axis and the second to top X/bottom Y axis.
xlab,ylab Vectors with two components describing axis's title. Vector's component can be either character strings or expressions (in latter case axis title is formatted according to rules described in plotmath). First component is related to bottom X/left Y axis and the second to top X/bottom Y axis.
ticks.in Direction of tick marks. By default they are drawn inside plot area.
grill Draw or not gridlines on plot.
Plabel Character string identifying the panel. It is not used internally and may have arbitrary value. Two panels in figure may have the same name. By default it is a concatenation of "Panel" string and the counter incrementing with every new panel added to the figure.
GROB If GROB is not NULL, function panel just copies it in the output and redraws it on the current.Figure. All other parameters are ignored in this case.
select If select is zero then new panel is created. If select is non-zero then function return select-th panel from figure's internal panel stack.
gp graphic parameters of underlying grid.plotarea GROB.
update.GUI If TRUE widgets in figure are updated to reflect changes of panel's properties. Setting to FALSE is useful only then you change properties of several panels in a loop and don't want figure to be updated after every iteration.

Details

panel() has side effect of setting variable current.Panel inside parent figure's environment to panel()'s return value. Although xticks, yticks are character vectors they can contain code chunks that are parsed and evaluated when panel is redrawn (see details in grid.plotarea).

Value

An R-environment structure of class "panel" with following fields and methods:

element() method for adding new data line to panel or accessing specific element inside panel (see element, grid.data).
annotation() method for adding new text annotation to panel or accessing specific annotation inside panel (see annotation, grid.text).

For a list of other fields and methods - do ls(current.Figure$current.Panel).

Definition

panel( x=c(2,9), y=c(2,9), scale.X=c(-10,10), scale.Y=c(-10,10), xticks=c("","Inf"), yticks=c("","Inf"), xlab=c("X Label",""), ylab=c("YLabel", ""), ticks.in=TRUE, grill=FALSE, Plabel=paste("Panel",panelsCount), gp=gpar(lwd=2,fontsize=12,fontface=1), GROB=NULL, select=0, update.GUI=T)

Author(s)

M.Kondrin

See Also

element, annotation, grid.data, grid.plotarea, grid.text, assign, get

Examples

figure()$panel()

[Package RGrace version 0.6-6 Index]