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())

