View source: R/S02-legacy_functions.R View source: R/S02-add_node_shape.R
add_node_shape | R Documentation |
Given a list with the x and y-axis coordinates for the bottom, left, top, and right of the internal text box, draws a specified shape on an existing plot.
add_node_shape(
nd,
shape = "box",
shape.col = "white",
shape.lwd = 2,
shape.border = "black",
shape.lty = 1,
shape.x = NA,
shape.y = NA,
xpd = NA
)
nd |
A named list of vectors with the Cartesian coordinates for the bottom, left, top, and right of the internal text box for the node. |
shape |
The default shape for nodes, either 'box', or 'circle'. |
shape.col |
The fill color for the node. |
shape.lwd |
The line wide for the node border. |
shape.border |
The mode border color
( |
shape.lty |
The line type for the node. |
shape.x |
The fixed width for the x-axis. |
shape.y |
The fixed height for the y-axis. |
xpd |
A logical value or NA. If |
# Empty plot
create_base_figure()
# Named list of coordinates
nd = list(
top = c( .5, .6 ),
bottom = c( .5, .4 ),
left = c( .4, .5 ),
right = c( .6, .5 )
)
# Rectangle
add_node_shape( nd )
# Ellipse
add_node_shape(
nd, shape = 'circle',
shape.border = 'blue', shape.lty = 2
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.