grid                  package:base                  R Documentation

_A_d_d _G_r_i_d _t_o _a _P_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     `grid' adds an `nx' by `ny' rectangular grid to an existing plot,
     using lines of type `lty' and color `col'.

     If more fine tuning is required, use `abline(h = ., v = .)'
     directly.

_U_s_a_g_e:

     grid(nx = NULL, ny = NULL, col = "lightgray", lty = "dotted")

_A_r_g_u_m_e_n_t_s:

   nx,ny: number of cells of the grid in x and y direction. Defaults to
          the number of tick marks on the corresponding axis.

     col: character or (integer) numeric; color of the grid lines.

     lty: character or (integer) numeric; line type of the grid lines.

_S_e_e _A_l_s_o:

     `plot', `abline', `lines', `points'.

_E_x_a_m_p_l_e_s:

     data(iris)
     ## maybe change the desired number of tick marks:  par(lab=c(mx,my,7))
     plot(iris$Sepal.L, iris$Sepal.W, col = rep(1:3, rep(50, 3)),
          xlim = c(4, 8), ylim = c(2, 4.5), panel.first = grid())

