drawBox {draw} | R Documentation |
Draw a Box on the Page
Description
Draws a box on the page given positioning, dimensions and styling.
Usage
drawBox(x, y, width = .pkgenv$boxWidth, height = .pkgenv$boxHeight,
radius = .pkgenv$boxRadius, fillColor = .pkgenv$boxFillColor,
opacity = .pkgenv$boxOpacity, lineColor = .pkgenv$boxLineColor,
lineWidth = .pkgenv$boxLineWidth, lineType = .pkgenv$boxLineType,
units = .pkgenv$units, ...)
Arguments
x |
Numeric value for the x-axis position of the center. |
y |
Numeric value for the y-axis position of the center. |
width |
Numeric value for the width. |
height |
Numeric value for the height. |
radius |
Numeric value for the radius to create rounded box corners. |
fillColor |
Character value for the fill color. |
opacity |
Numeric value for the transparency with values ranging from 0 (transparent) to 1 (non-transparent). |
lineColor |
Character value for the color of the lines. |
lineWidth |
Numeric value for the width of the lines. |
lineType |
Character value for the line type. One of "blank", "solid", "dashed", "dotted", "dotdash", "longdash", or "twodash" (see "lty" in par). |
units |
Character value for the unit to use when specifying measurements. |
... |
Additional arguments passed to grid.rect. |
Value
See Also
Examples
library(draw)
# Set drawing settings
drawSettings(pageWidth = 5, pageHeight = 5, units = "inches")
# Create a new drawing page
drawPage()
# Draw a square
drawBox(x = 1, y = 4, width = 1, height = 1)
# Draw a square with rounded corners
drawBox(x = 4, y = 4, width = 1, height = 1, radius = 0.25)
# Draw a rectangle
drawBox(x = 1, y = 1, width = 1, height = 0.5)
# Draw a rectangle with rounded corners
drawBox(x = 4, y = 1, width = 1, height = 0.5, radius = 0.25)
# Export the drawing page to a PDF
drawExport("drawBox.pdf")
[Package draw version 1.0.0 Index]