View source: R/new_triangles.R
new_rights | R Documentation |
Right triangle shapes defined as a collection of right triangles
sharing the same subset of locating arguments (x
, y
,
loc
, px
, py
, b
, h
, e
, re
,
and te
, hb
, hh
, au
). Right triangles are
located in plotting regions using bounding rectangles, a concept used in
defining function parameters. See the defining bounding rectangles
section for details.
new_rights( pj, x, y, b = NA, h = NA, hyp = NA, re = NA, te = NA, hb = NA, hh = NA, loc = "bl", px = 0.5, py = 0.5, au = "r", region = ".", look = NULL, mod = NULL, name = "." )
pj |
an object of class |
x |
numeric vector giving horizontal location. When |
y |
numeric vector giving vertical location. When |
b |
|
h |
|
hyp |
|
re |
|
te |
|
hb |
|
hh |
|
loc |
character vector indicating where the 90-degree angle of the right
triangles are located. |
px |
|
py |
|
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 defined right triangles.
Bounding rectangles can be located in
a number of ways. The following shows valid combination of non-NA
locating arguments:
(x + px) + (y + py) + b + h
(x anchor) + (y anchor) + base + height
(x + px) + (y + py) + b + hyp
(x anchor) + (y anchor) + base + hypotenuse
(x + px) + (y + py) + h + hyp
(x anchor) + (y anchor) + height + hypotenuse
(x + px) + (y + py) + b + hb
(x anchor) + (y anchor) + base + base/hypotenuse angle
(x + px) + (y + py) + b + hh
(x anchor) + (y anchor) + base + height/hypotenuse angle
(x + px) + (y + py) + h + hb
(x anchor) + (y anchor) + height + base/hypotenuse angle
(x + px) + (y + py) + h + hh
(x anchor) + (y anchor) + height + height/hypotenuse angle
(x + px) + (y + py) + hyp + hb
(x anchor) + (y anchor) + hypotenuse + base/hypotenuse angle
(x + px) + (y + py) + hyp + hh
(x anchor) + (y anchor) + hypotenuse + height/hypotenuse angle
(x + px) + b + y + te
(x-anchor) + base + bottom edge + top edge
x + re + (y + py) + h
left edge + right edge + (y-anchor) + height
x + re + y + te
left edge + right edge + bottom edge + top edge
The argument set {x, y, b, h, e, re, te,
be, ee, au, px, py, loc}
is recycled.
px
, and py
When px
is not
NA
, it represents where the value x
is located as a
proportion of the distance between the left and right edge of each bounding
rectangle. Likewise, when py
is not NA
, it represents where
the value y
is located as a proportion of the distance between the
bottom and top edge of each bounding rectangle. For example:
when px = 0.5
and py = 0.5
, the center of the
bounding rectangle is located at (x, y)
.
when px = 0
and py = 0
, the bottom left corner of the
bounding rectangle is located at (x, y)
.
when px = 1
and py = 1
, the top right corner of the
bounding rectangle is located at (x, y)
.
when px = 1/3
and py = 2/3
, the point 1/3 of the way
from left to right edge and 2/3 of the way from bottom to top edge
of the bounding rectangle is located at (x, y)
.
px
and py
can be less than 0 or greater than 1, resulting in
the fixed point (x, y)
being outside the bounding rectangle.
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_triangles:
new_isosceles()
,
new_triangles()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.