grid.rect                package:grid                R Documentation

_D_r_a_w _r_e_c_t_a_n_g_l_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions create and draw rectangles.

_U_s_a_g_e:

     grid.rect(x = unit(0.5, "npc"), y = unit(0.5, "npc"),
               width = unit(1, "npc"), height = unit(1, "npc"),
               just = "centre", hjust = NULL, vjust = NULL,
               default.units = "npc", name = NULL,
               gp=gpar(), draw = TRUE, vp = NULL)
     rectGrob(x = unit(0.5, "npc"), y = unit(0.5, "npc"),
              width = unit(1, "npc"), height = unit(1, "npc"),
              just = "centre", hjust = NULL, vjust = NULL, 
              default.units = "npc", name = NULL,
              gp=gpar(), vp = NULL)

_A_r_g_u_m_e_n_t_s:

       x: A numeric vector or unit object specifying x-location.

       y: A numeric vector or unit object specifying y-location.

   width: A numeric vector or unit object specifying width.

  height: A numeric vector or unit object specifying height.

    just: The justification of the rectangle  relative to its (x, y)
          location.  If there are two values, the first value specifes
          horizontal justification and the second value specifies
          vertical justification.  Possible string values are:
          '"left"', '"right"', '"centre"', '"center"', '"bottom"', and
          '"top"'.  For numeric values, 0 means left alignment and 1
          means right alignment. 

   hjust: A numeric vector specifying horizontal justification. If
          specified, overrides the 'just' setting.

   vjust: A numeric vector specifying vertical justification. If
          specified, overrides the 'just' setting.

default.units: A string indicating the default units to use if 'x',
          'y', 'width', or 'height' are only given as numeric vectors.

    name: A character identifier. 

      gp: An object of class 'gpar', typically the output from a call
          to the function 'gpar'.  This is basically a list of
          graphical parameter settings.

    draw: A logical value indicating whether graphics output should be
          produced.

      vp: A Grid viewport object (or NULL).

_D_e_t_a_i_l_s:

     Both functions create a rect grob (a graphical object describing
     rectangles), but only 'grid.rect' draws the rectangles (and then
     only if 'draw' is 'TRUE').

_V_a_l_u_e:

     A rect grob.  'grid.rect' returns the value invisibly.

_A_u_t_h_o_r(_s):

     Paul Murrell

_S_e_e _A_l_s_o:

     Grid, 'viewport'

