home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / barplot < prev    next >
Encoding:
Text File  |  1997-04-23  |  3.0 KB  |  88 lines

  1.     
  2.     _B_a_r_p_l_o_t_s
  3.     
  4.          barplot(height, names.arg, col, border=par("fg"),
  5.                  beside=FALSE, space=0.2, legend.text,
  6.                  main=NULL, xlab=NULL, ylab=NULL,
  7.                  xlim, ylim)
  8.     
  9.     _A_r_g_u_m_e_n_t_s:
  10.     
  11.           height : either a vector or matrix of values descibing
  12.                    the the bars which make up the plot.  If
  13.                    height is a vector, the plot consists of a
  14.                    sequence of rectangular bars with heights
  15.                    given by the values in the vector.  If height
  16.                    is a matrix and beside is FALSE then each bar
  17.                    of the plot corresponds to a column of
  18.                    height, with the values in the column giving
  19.                    the heights of stacked ``sub-bars'' making up
  20.                    the bar.  If height is a matrix and beside is
  21.                    TRUE, then the values in each column are jux-
  22.                    taposed rather than stacked.
  23.     
  24.        names.arg : a vector of names to be plotted below each
  25.                    bar or group of bars.  If this argument is
  26.                    omitted, then the names are taken from the
  27.                    names attribute of height if height is a vec-
  28.                    tor, or the column names of height if height
  29.                    is a matrix.
  30.     
  31.              col : a vector of colors for the bars or bar com-
  32.                    ponents.
  33.     
  34.           border : The color to be used for the border of the
  35.                    bars.
  36.     
  37.           beside : a logical value.  If FALSE, the columns of
  38.                    height are portrayed as stacked bars, and if
  39.                    TRUE the columns are portrayed as juxtaposed
  40.                    bars.
  41.     
  42.            space : the relative amount of space between the bars
  43.                    or groups of bars. The width of a bar (or
  44.                    group of bars) plus the value of space is
  45.                    one.
  46.     
  47.      legend.text : a vector of text used to construct a legend
  48.                    for the plot.  This is only useful when
  49.                    height is a matrix.  In that case the legend
  50.                    labels should correspond to the rows of
  51.                    height.
  52.     
  53.             main : an overall title for the plot.
  54.     
  55.             xlab : a label for the x axis.
  56.     
  57.             ylab : a label for the y axis.
  58.     
  59.             xlim : limits for the x axis.
  60.     
  61.             ylim : limits for the y axis.
  62.     
  63.     _V_a_l_u_e:
  64.     
  65.          This function is invoked for its side effect of produc-
  66.          ing a barplot in the graphics window.  It returns no
  67.          useful value.
  68.     
  69.     _S_e_e _A_l_s_o:
  70.     
  71.          dotplot, hist.
  72.     
  73.     _E_x_a_m_p_l_e_s:
  74.     
  75.          data(deaths)
  76.          barplot(deaths, beside=TRUE,
  77.                  col=c("lightblue", "mistyrose", "lightcyan",
  78.                        "lavender", "cornsilk"),
  79.                  legend=rownames(deaths), ylim=c(0,100))
  80.          title(main="Death Rates in Virginia", font.main=4)
  81.     
  82.          barplot(t(deaths)[,5:1], beside=TRUE,
  83.                  col=c("lightblue", "mistyrose",
  84.                        "lightcyan", "lavender"),
  85.                  legend=colnames(deaths), ylim=c(0,80))
  86.          title(main="Death Rates in Virginia", font.main=4)
  87.     
  88.