drawPoint {draw} | R Documentation |
Draw a Point on the Page
Description
Draws a point on the page given positioning, dimensions and styling.
Usage
drawPoint(x, y, pch = .pkgenv$pointPCH, size = .pkgenv$pointSize,
fillColor = .pkgenv$pointFillColor, opacity = .pkgenv$pointOpacity,
lineColor = .pkgenv$pointLineColor, lineWidth = .pkgenv$pointLineWidth,
lineType = .pkgenv$pointLineType, 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. |
pch |
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. |
size |
Numeric value for the size of the point. |
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.points. |
Value
A grid.points grob object.
See Also
Examples
library(draw)
# Set drawing settings
drawSettings(pageWidth = 5, pageHeight = 5, units = "inches")
# Create a new drawing page
drawPage()
# Draw a square point
drawPoint(x = 1, y = 4, pch = 0)
# Draw a larger circle point
drawPoint(x = 4, y = 4, pch = 1, size = 1.5)
# Draw a triangle point
drawPoint(x = 1, y = 1, pch = 2, lineWidth = 2)
# Draw a red X point
drawPoint(x = 4, y = 1, pch = 4, lineColor = "red")
# Export the drawing page to a PDF
drawExport("drawPoint.pdf")