R_GE_gcontext-class {unknown} | R Documentation |
This is a one-to-one mapping of the C-level data structure used in R graphics devices and passed to device routines and it describes the current settings or state of the graphics "pen". It provides alues for the color, the background color, the line width, and line type, how lines are joined and ended, the character expansion factor, the size of a the font and line height, and font information. These are set and reset frequently and are stored in this context object rather than "globally" (across calls) within the device.
We rarely construct objects of this type directly in R but rather are passed them in calls to R functions from the graphics engine. These functions are those implementing R graphics device facilities.
We might explicitly coerce the C-level reference to an R structure
to have access to all of the fields in a single R object using
as(obj, "R_GE_gcontext")
. However,
this is not necessary as we can access the individual fields as
obj$col
as easily as obj@col
. There may be marginal
benefits in speed if one is accessing the values of all the fields
many, many times within the single R function call. But this requires
measurement as the slot access of an S4 object may incur overheads
comparable or exceeding that of the method dispatch and C interface.
col
:"integer"
the color to
draw text, lines, paths. This is the "foreground" color.fill
:"integer"
the background
color used to fill regions such as rectangles, circles and polygonsgamma
:"numeric"
the lwd
:"numeric"
the width of a
rendered line, typically in units of 1/96.lty
:"integer"
the type of
line, e.g. solid, dotted, dashed lend
:"R_GE_lineend"
one of
ROUND_CAP
, BUTT_CAP
and SQUARE_CAP
(currently integers at present and
not enumeration types) ljoin
:"R_GE_linejoin"
how
lines are joined. One of ROUND_JOIN
, MITRE_JOIN
,
BEVEL_JOIN
. (Currently these are integers. You should coerce them to R_GE_linejoin
.) lmitre
:"numeric"
controls
mitreing of linescex
:"numeric"
character
expansion factor with font size = fontsize * cex
ps
:"numeric"
font size in pointslineheight
:"numeric"
height
of a line which should be multiplied by the font sizefontface
:"integer"
font face
such as plain, italic, bold. These are given by integers.fontfamily
:"character"
a
character vector currently with 201 elements each of which is a single
character, i.e. string of length 1. But this is may become a single
string with 201 characters.
Class "CStruct-class"
, directly.
No methods defined with class "R_GE_gcontext" in the signature.
Duncan Temple Lang
“The R Internals Manual”, R Development Core Team.
graphicsDevice
RDevDescMethods-class
showClass("R_GE_gcontext")