splitplot             package:ifultools             R Documentation

_P_a_r_t_i_t_i_o_n_s _p_l_o_t _s_p_a_c_e _i_n_t_o _r_e_c_t_a_n_g_u_l_a_r _g_r_i_d

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

     Uses the 'plt' argument of the 'par' function to divide the space
     according to the input grid.

_U_s_a_g_e:

     splitplot(nrows, ncols, i=1, new=as.logical(i > 1 && i <= nrows*ncols), gap=0.15)

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

   nrows: an integer defining the number of desired rows in the plot
          grid.

   ncols: an integer defining the number of desired column in the plot
          grid.

     gap: a numeric scalar used a nudge factor for the gap between
          plots in both the x- and y-directions. Default: '0.15'.

       i: selects the 'i'th plot of the current 'nrow' by 'ncol' plot
          grid for the next plot. The upper left plot region is denoted
          by 'i=1' and increments moving from left to right, then top
          to bottom. Default: '1'.

     new: a logical flag. If 'TRUE', a new plot grid is established and
          previously defined plot regions are erases. Default:
          'as.logical(i > 1)'.

_V_a_l_u_e:

     the original 'plt' value of the 'par' function prior to the call.
     The user can use this to reset 'plt' to its original values.

_N_o_t_e:

     The 'plt' option of the 'par' function is altered.

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

     'stackPlot'.

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

     ## establish a 2x2 plot grid and select the first 
     ## for plotting 
     old.plt <- splitplot(2,2,1)

     ## plot the data 
     for (i in seq(4)){
         if (i > 1)
            splitplot(2,2,i)

         plot(rnorm(100)*i)
         mtext(paste("i=", i, sep=""), side=3, line=0.5)
     }

     ## return the original plot state of plt in par 
     par(old.plt)

