View source: R/new_polycurve.R
new_area | R Documentation |
An area shape is a polygon defined as the area between a curve (a set of x-y pairs) and a reference line. The default reference line is the x-axis.
new_area( pj, x, y, ref = "x", dir = "v", x1 = NA, y1 = NA, x2 = NA, y2 = NA, s = NA, i = NA, a = NA, au = "r", region = ".", look = NULL, mod = NULL, name = "." )
pj |
an object of class |
x |
numeric vector defining the horizontal locations of points on a
curve. The longer of |
y |
numeric vector defining the vertical locations of points on a curve.
The longer of |
ref |
|
dir |
character scalar identifying the directional orientation of the
reference line, where |
x1 |
|
y1 |
|
x2 |
|
y2 |
|
s |
|
i |
|
a |
|
au |
|
region |
either character scalar |
look |
an optional list containing up to four lists specifying looks to
apply to the shape. See the using |
mod |
an optional list containing up to four lists specifying
modifications to apply to the shape. See the using |
name |
character scalar indicating a name for the shape. The special
value |
pj
with the addition of the specified area shape.
Valid combinations of non-NA
locating arguments are given below.
ref
Pre-defined reference line
x1
Vertical line at x1
.
y1
Horizontal line at y1
.
x1 + y1 + x2 + y2
Point-point definition (line through
(x1, y1)
and (x2, y2)
).
x1 + y1 + a
Point-angle definition (line through
(x1, y1)
at angle a
).
x1 + y1 + i
Point-intercept definition (line through
intercept and (x1, y1)
).
x1 + y1 + s
Point-slope definition (line through
(x1, y1)
with slope s
).
a + i
Angle-intercept definition (line through intercept
at angle a
).
s + i
Slope-intercept definition (line through intercept
with slope s
.
The argument set {x, y}
is recycled.
look
to make shapes appearBy itself, this function
simply defines the location of x-y pairs in the assigned region for the
specified shape. Various looks can be added to the shape using the
look
parameter or via the add_ends
,
add_fills
, add_glyphs
,
add_labels
, add_lines
, and
add_marks
functions. Sub-lists of the look argument must be
named 'end'
, 'fill'
, 'glyph'
, 'label'
,
'line'
, and/or 'mark'
to indicate that line end marks, fill
colors, glyphs (single characters), labels, lines, and/or point marks be
added to the shape.
mod
to transform shapesShapes can be transformed in
four ways: dilation, reflection, rotation, and translation/. using the
mod
argument or the mod_dilate
,
mod_reflect
, mod_rotate
, and
mod_translate
. Sub-lists of the mod
argument must be
named 'dilate'
, 'reflect'
, 'rotate'
, and/or
'translate'
to indicate that a dilation, reflection, rotation, and
or translation be applied to the shape.
Other new_polycurve:
new_ribbon()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.