

polygon {base}                               R Documentation

_P_o_l_y_g_o_n _D_r_a_w_i_n_g

_D_e_s_c_r_i_p_t_i_o_n_:

     `polygon' draws the polygons whose vertices are given
     in `x' and `y'.

_A_r_g_u_m_e_n_t_s_:

     x,y: vectors containing the coordinates of the vertices
          of the polygon.

 density: density of fill pattern. NOT YET implemented.

   angle: angle of fill pattern. NOT YET implemented.

  border: the color to draw the border.  Defaults to
          `par("fg")'.  Use `border=0' to omit borders.

     ...: graphical parameters can be given as arguments to
          `polygon', must importantly,

     col: an integer specifying the color to be used in
          filling the polygon.  The default is to leave
          polygons unfilled.

_S_e_e _A_l_s_o_:

     `segments' for even more flexibility, `lines', `rect',
     `box', `abline'.

_E_x_a_m_p_l_e_s_:

     n <- 100
     xx <- c(0:n, n:0)
     yy <- c(c(0,cumsum(rnorm(n))), rev(c(0,cumsum(rnorm(n)))))
     plot   (xx, yy, type="n", xlab="Time", ylab="Distance")
     polygon(xx, yy, col="gray", border = "red")
     title("Distance Between Brownian Motions")

