
Last chance! 50% off unlimited learning
Sale ends in
Draws a curve on the page given positioning, dimensions and styling.
drawCurve(x, y, curvature = .pkgenv$curveCurvature,
angle = .pkgenv$curveAngle, points = .pkgenv$curvePoints,
shape = .pkgenv$curveShape, square = .pkgenv$curveSquare,
squareShape = .pkgenv$curveSquareShape, opacity = .pkgenv$curveOpacity,
lineColor = .pkgenv$curveLineColor, lineWidth = .pkgenv$curveLineWidth,
lineType = .pkgenv$curveLineType, inflect = .pkgenv$curveInflect,
open = .pkgenv$curveOpen, arrowAngle = .pkgenv$arrowAngle,
arrowLength = .pkgenv$arrowLength, arrowUnits = .pkgenv$arrowUnits,
arrowEnds = .pkgenv$arrowEnds, arrowType = .pkgenv$arrowType,
units = .pkgenv$units, ...)
Numeric vector of length 2 for x-axis position of starting and ending points.
Numeric vector of length 2 for y-axis position of starting and ending points.
Numeric value for the curvature of the curve. Values of 0 create a straight line, negative values create left-hand curves, and positive values create right-hand curves.
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.
Numeric value for the number of curve control points with higher numbers creating a smoother curve.
Numeric value for the shape of the curve ranging from -1 to 1 (See grid.xspline).
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 points is 1 and angle is 90, and FALSE otherwise (see grid.curve).
Numeric value controlling curve behaviours relative to control points. Applies if square is TRUE.
Numeric value for the transparency with values ranging from 0 (transparent) to 1 (non-transparent).
Character value for the color of the lines.
Numeric value for the width of the lines.
Character value for the line type. One of "blank", "solid", "dashed", "dotted", "dotdash", "longdash", or "twodash" (see "lty" in par).
Logical value indicating if the curve should be cut in half and inverted (TRUE) or not (FALSE).
Logical value indicating whether to open the curve (TRUE) or close the curve (FALSE).
Numeric value of the angle for arrows. Smaller numbers create narrower arrows, and larger numbers produce wider arrows.
Numeric value of the length for arrows.
Character value of the measurement unit for arrows.
Character value indicating which end to draw arrows on lines. Must be one of "last", "first" or "both".
Character value indicating if the arrow heads should be closed or open. Must be one of "open" or "closed".
Character value for the unit to use when specifying measurements.
Additional arguments passed to grid.curve.
A grid.curve grob object.
# NOT RUN {
library(draw)
# Set drawing settings
drawSettings(pageWidth = 5, pageHeight = 5, units = "inches")
# Create a new drawing page
drawPage()
# Draw a curved angle
drawCurve(x = c(1, 4),
y = c(1, 2),
angle = 90)
# Draw a curved angle with arrows
drawCurve(x = c(1, 4),
y = c(2, 3.75),
angle = 90, arrowLength = 0.1, arrowEnd = "both")
# Draw an inflected curve
drawCurve(x = c(1, 4),
y = c(3, 4),
angle = 90, inflect = TRUE)
# Export the drawing page to a PDF
drawExport("drawCurve.pdf")
# }
Run the code above in your browser using DataLab