place_rule | R Documentation |
A wrapper function for graphics::locator
that helps in creating rules.
place_rule(x_axis, y_axis, line_type = "f")
is.rule_points(x)
x_axis |
a character string indicating the colour variable that
corresponds to the x axis, one of |
y_axis |
a character string indicating the colour variable that
corresponds to the y axis, one of |
line_type |
a character string indicating that the line is vertical
( |
x |
the R object being tested |
This function calls graphics::locator
on a previously plotted
rgb plane to select two points with the mouse. Then it plots the line
joining them and returns an object of class "pixel_rule_object"
.
These objects are passed as parameters to pixel_rule()
to create
"pixel_rule"
objects.
True horizontal and vertical lines are difficult to create by hand. In
these cases, specifying "vertical"
or "horizontal"
(partial
match allowed, i.e. "h"
) will copy the appropriate coordinate value
from the first point to the second to make them the same. Note that this is
done after locator()
returns, so the plot will show the line joining
the original points, not the corrected ones. Use plot_rule()
to see
the corrected line.
An object of class "pixel_rule_points"
containing these
elements:
x_axis
: a character string containing the colour variable
selected as x
axis (one of "r, "g or "b").
y_axis
: a character string containing the colour variable
selected as y
axis.
locator
, pixel_rule
,
plot_rule
, plot_rgb_plane
## Not run:
plot_rgb_plane("r", "g")
line01 <- place_rule("r", "g") # A "free" line
line02 <- place_rule("r", "g", "h") # A horizontal line
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.