Low-level plotting commands Flashcards Preview

R > Low-level plotting commands > Flashcards

Flashcards in Low-level plotting commands Deck (17)
Loading flashcards...
1

points(x, y)

adds points (the option type= can be used)

2

lines(x, y)

id. but with lines

3

text(x, y, labels, ...)

adds text given by labels at coordi-
nates (x,y); a typical use is: plot(x, y, type="n"); text(x, y, names)

4

mtext(text, side=3, line=0, ...)

adds text given by text in the margin specified by side (see axis() below); line specifies the line from the plotting area

5

segments(x0, y0, x1, y1)

draws lines from points (x0,y0) to points (x1,y1)

6

arrows(x0, y0, x1, y1, angle= 30, code=2)

id. with arrows at points (x0,y0) if code=2, at points (x1,y1) if code=1, or both if code=3; angle controls the angle from the shaft of the arrow to the edge of the arrow head

7

abline(a,b)

draws a line of slope b and intercept a

8

abline(h=y)

draws a horizontal line at ordinate y

9

abline(v=x)

draws a vertical line at abcissa x

10

abline(lm.obj)

draws the regression line given by lm.obj

11

rect(x1, y1, x2, y2)

draws a rectangle which left, right, bottom, and
top limits are x1, x2, y1, and y2, respectively

12

polygon(x, y)

draws a polygon linking the points with coordinates given
by x and y

13

legend(x, y, legend)

adds the legend at the point (x,y) with the sym-
bols given by legend

14

title()

adds a title and optionally a sub-title

15

axis(side, vect)

adds an axis at the bottom (side=1), on the left (2),
at the top (3), or on the right (4); vect (optional) gives the abcissa (or
ordinates) where tick-marks are drawn

16

rug(x)

draws the data x on the x-axis as small vertical lines

17

locator(n, type="n", ...)

returns the coordinates (x,y) after the
user has clicked n times on the plot with the mouse; also draws sym- bols (type="p") or lines (type="l") with respect to optional graphic parameters (...); by default nothing is drawn (type="n")