drawPoint: Draw a Point on the Page

Description Usage Arguments Value See Also Examples

Description

Draws a point on the page given positioning, dimensions and styling.

Figure: drawPoint Example

Usage

1
2
3
4
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

drawSettings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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")

draw documentation built on May 2, 2019, 8:30 a.m.