rug                 package:graphics                 R Documentation

_A_d_d _a _R_u_g _t_o _a _P_l_o_t

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

     Adds a _rug_ representation (1-d plot) of the data to the plot.

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

     rug(x, ticksize = 0.03, side = 1, lwd = 0.5, col = par("fg"),
         quiet = getOption("warn") < 0, ...)

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

       x: A numeric vector

ticksize: The length of the ticks making up the 'rug'. Positive lengths
          give inwards ticks.

    side: On which side of the plot box the rug will be plotted.
          Normally 1 (bottom) or 3 (top).

     lwd: The line width of the ticks.  Some devices will round the
          default width up to '1'.

     col: The colour the ticks are plotted in.

   quiet: logical indicating if there should be a warning about clipped
          values.

     ...: further arguments, passed to 'axis', such as 'line' or 'pos'
          for specifying the location of the rug.

_D_e_t_a_i_l_s:

     Because of the way 'rug' is implemented, only values of 'x' that
     fall within the plot region are included.  There will be a warning
     if any finite values are omitted, but non-finite values are
     omitted silently.

     Prior to R 2.8.0 'rug' re-drew the axis like: it no longer does
     so.

_R_e_f_e_r_e_n_c_e_s:

     Chambers, J. M. and Hastie, T. J. (1992) _Statistical Models in
     S._ Wadsworth & Brooks/Cole.

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

     'jitter' which you may want for ties in 'x'.

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

     require(stats)# both 'density' and its default method
     with(faithful, {
         plot(density(eruptions, bw = 0.15))
         rug(eruptions)
         rug(jitter(eruptions, amount = 0.01), side = 3, col = "light blue")
     })

