Description Usage Arguments Details Value Examples
Modify Default Drawing Settings
1 |
... |
Default settings to modify draw package settings stored in an environment. |
The following parameters are available to change:
*
units [default = "inches"]: Character value of default measurement unit for applicable draw function parameters (such as width, height, radius, x, y, etc).
arrow
arrowAngle [default = 30]: Numeric value of the angle for arrows. Smaller numbers create narrower arrows, and larger numbers produce wider arrows.
arrowLength [default = 0]: Numeric value of the length for arrows.
arrowUnits [default = units]: Character value of the measurement unit for arrows. Default is the same as units parameter under *.
arrowEnds [default = "last"]: Character value indicating which end to draw arrows on lines. Must be one of "last", "first" or "both".
arrowType [default = "open"]: Character value indicating if the arrow heads should be closed or open. Must be one of "open" or "closed".
drawBox
boxWidth [default = 1]: Numeric value of the width for boxes.
boxHeight [default = 1]: Numeric value of the height for boxes.
boxRadius [default = 0]: Numeric value of the radius for boxes to create rounded corners.
boxFillColor [default = "transparent"]: Character value of the color to fill boxes with.
boxOpacity [default = 1]: Numeric value of transparency for boxes ranging from 0 (transparent) to 1 (non-transparent).
boxLineWidth [default = 1]: Numeric value of the width for the box lines.
boxLineType [default = "solid"]: Character value of the type of line for the boxes. One of "blank", "solid", "dashed", "dotted", "dotdash", "longdash", or "twodash" (see "lty" in par).
boxLineColor [default = "black"]: Character value of the color for the box lines.
drawCircle
circleRadius [default = 0.5]: Numeric value of the radius for circles.
circleFillColor [default = "transparent"]: Character value of the color to fill circles with.
circleOpacity [default = 1]: Numeric value of the transparency for circles ranging from 0 (transparent) to 1 (non-transparent).
circleLineWidth [default = 1]: Numeric value of the width for the circle lines.
circleLineType [default = "solid"]: Character value of the type of line for the circles. One of "blank", "solid", "dashed", "dotted", "dotdash", "longdash", or "twodash" (see "lty" in par).
circleLineColor [default = "black"]: Character value of the color for the circle lines.
drawCurve
curveCurvature [default = 1]: Numeric value of the curvature for the curves. Values of 0 create a straight line, negative values create left-hand curves, and positive values create right-hand curves.
curveAngle [default = 90]: Numeric value of the curve control point skewness ranging from 0 to 180. Values less than 90 skew towards the start point, and values more than 90 skew towards the end point.
curvePoints [default = 1]: Numeric value of the number of control points for the curves, where higher values create smoother curves.
curveShape [default = 0.5]: Numeric value of the shape for the curves ranging from -1 to 1 (See grid.xspline).
curveSquare [default = TRUE]: Logical value indicating whether curve control points are created in a city-block or oblique way. It is recommended to set this to TRUE if curvePoints is 1 and curveAngle is 90, and FALSE otherwise (see grid.curve).
curveSquareShape [default = 1]: Numeric value controlling curve behaviours relative to control points. Applies if curveSquare is TRUE.
curveOpacity [default = 1]: Numeric value of the transparency for the curves ranging from 0 (transparent) to 1 (non-transparent).
curveLineColor [default = "black"]: Character value of the color for the curve lines.
curveLineWidth [default = 1]: Character value of the width for the curve lines.
curveLineType [default = "solid"]: Character value of the type of line for the curves. One of "blank", "solid", "dashed", "dotted", "dotdash", "longdash", or "twodash" (see "lty" in par).
curveInflect [default = FALSE]: Logical value indicating if curve should be cut in half and inverted (TRUE) or not (FALSE).
curveOpen [default = TRUE]: Logical value indicating whether to open the curves (TRUE) or close the curves (FALSE).
drawExport
exportUnits [default = units]: Character value of measurement unit for exporting. Default is the same as units parameter under *.
exportPPI [default = 150]: Numeric value of the image quality measured in Pixels Per Inch (PPI).
drawLine
lineOpacity [default = 1]: Numeric value of the transparency of the lines ranging from 0 (transparent) to 1 (non-transparent).
lineWidth [default = 1]: Numeric value of the width of the lines.
lineType [default = "solid"]: Character value of the type for the lines. One of "blank", "solid", "dashed", "dotted", "dotdash", "longdash", or "twodash" (see "lty" in par).
lineColor [default = "black"]: Character value of the color of the lines.
drawPage
pageWidth [default = 8.5]: Numeric value of the width of the drawing page.
pageHeight [default = 11]: Numeric value of the height of the drawing page.
drawPoint
pointPCH [default = 20]: Numeric value indicating which plotting symbol to use (see points). Some examples include 0 for square, 1 for circle, 2 for triangle, and 4 for X.
pointSize [default = 1]: Numeric value of the point size.
pointFillColor [default = "transparent"]: Character value of the color to fill each point.
pointOpacity [default = 1]: Numeric value of the transparency for the points ranging from 0 (transparent) to 1 (non-transparent).
pointLineColor [default = "black"]: Character value of the color of the points.
pointLineType [default = "solid"]: Character value of the type for the lines. One of "blank", "solid", "dashed", "dotted", "dotdash", "longdash", or "twodash" (see "lty" in par).
pointLineWidth [default = 1]: Numeric value of the width of the point lines.
drawText
text [default = "text"]: Character value of the text to display at the defined position.
textJust [default = "centre"]: Character value of the text justification. One of "left", "right", "centre", "center", "bottom", or "top".
textHjust [default = NULL]: Numeric value of the horizontal justification.
textVjust [default = NULL]: Numeric value of the vertical justification.
textAngle [default = 0]: Numeric value of the angle to rotate text.
textOverlap [default = FALSE]: Logical value indicating if overlapping text should be removed (TRUE) or not (FALSE).
textOpacity [default = 1]: Numeric value of the transparency for text ranging from 0 (transparent) to 1 (non-transparent).
textColor [default = "black"]: Character value of the color for text.
textSize [default = 12]: Numeric value of the text font size in pt.
textFace [default = "plain"]: Character value of the text font face. One of "plain", "bold", "italic", "oblique", and "bold.italic" (see fontface in gpar).
textFamily [default = "sans"]: Character value of text font family to use (see family in par). Common values are "serif", "sans" and "mono".
textLineHeight [default = 1.2]: Numeric value of text line height as a multiple of the size of the text.
A list of the current draw settings with changes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(draw)
# Set page dimensions and units to inches
drawSettings(pageWidth = 5, pageHeight = 5, units = "inches")
# Set export resolution in Pixels Per Inch (PPI)
drawSettings(exportPPI = 300)
# Set default width and height for all boxes in inches
drawSettings(boxWidth = 1, boxHeight = 1)
# Create a new drawing page
drawPage()
# Draw default 1 by 1 inch boxes near the center
drawBox(x = 2, y = 2.5)
drawBox(x = 3, y = 2.5)
# Draw a non-default 2 by 2 inch box in the center
drawBox(x = 2.5, y = 2.5, width = 2, height = 2)
# Export the current drawing page
drawExport("drawSettingsExample.pdf")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.