click_shape | R Documentation |
R
graphicsAdd shapes anywhere in a plot (including margins) with mouse click(s).
click_shape(
shape = c("circle", "arrow", "rect", "cyl", "line", "poly"),
corners = 3L,
...
)
shape |
type of shape; choices are |
corners |
number of corners to draw if |
... |
additional arguments or graphical parameters passed to the shape functions |
click_text
, rect
,
arrows
, rect
, rect
,
segments
, polygon
,
draw.circle
, cylindrect
## Not run:
op <- par(xpd = NA)
plot.new()
plot.window(0:1, 0:1, asp = 1)
click_shape('line') # a line segment
click_shape('arrow', col = 'blue', code = 2, lwd = 2, length = .15)
click_shape('rect', border = 'purple', col = 'pink', lwd = 2)
click_shape('rect', col = NULL, border = 'purple', lwd = 2)
click_shape('line', col = 'orange', lty = 3, lwd = 3)
click_shape('poly', corners = 5, border = 'green', col = 'orange')
click_shape('poly', corners = 3, border = 'red', col = 'yellow', lty = 1)
click_shape('cyl', col = 'orange')
click_shape('circle', col = 'orange', border = 'black', lty = 3, lwd = 3)
par(op)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.