home *** CD-ROM | disk | FTP | other *** search
-
- _B_a_r_p_l_o_t_s
-
- barplot(height, names.arg, col, border=par("fg"),
- beside=FALSE, space=0.2, legend.text,
- main=NULL, xlab=NULL, ylab=NULL,
- xlim, ylim)
-
- _A_r_g_u_m_e_n_t_s:
-
- height : either a vector or matrix of values descibing
- the the bars which make up the plot. If
- height is a vector, the plot consists of a
- sequence of rectangular bars with heights
- given by the values in the vector. If height
- is a matrix and beside is FALSE then each bar
- of the plot corresponds to a column of
- height, with the values in the column giving
- the heights of stacked ``sub-bars'' making up
- the bar. If height is a matrix and beside is
- TRUE, then the values in each column are jux-
- taposed rather than stacked.
-
- names.arg : a vector of names to be plotted below each
- bar or group of bars. If this argument is
- omitted, then the names are taken from the
- names attribute of height if height is a vec-
- tor, or the column names of height if height
- is a matrix.
-
- col : a vector of colors for the bars or bar com-
- ponents.
-
- border : The color to be used for the border of the
- bars.
-
- beside : a logical value. If FALSE, the columns of
- height are portrayed as stacked bars, and if
- TRUE the columns are portrayed as juxtaposed
- bars.
-
- space : the relative amount of space between the bars
- or groups of bars. The width of a bar (or
- group of bars) plus the value of space is
- one.
-
- legend.text : a vector of text used to construct a legend
- for the plot. This is only useful when
- height is a matrix. In that case the legend
- labels should correspond to the rows of
- height.
-
- main : an overall title for the plot.
-
- xlab : a label for the x axis.
-
- ylab : a label for the y axis.
-
- xlim : limits for the x axis.
-
- ylim : limits for the y axis.
-
- _V_a_l_u_e:
-
- This function is invoked for its side effect of produc-
- ing a barplot in the graphics window. It returns no
- useful value.
-
- _S_e_e _A_l_s_o:
-
- dotplot, hist.
-
- _E_x_a_m_p_l_e_s:
-
- data(deaths)
- barplot(deaths, beside=TRUE,
- col=c("lightblue", "mistyrose", "lightcyan",
- "lavender", "cornsilk"),
- legend=rownames(deaths), ylim=c(0,100))
- title(main="Death Rates in Virginia", font.main=4)
-
- barplot(t(deaths)[,5:1], beside=TRUE,
- col=c("lightblue", "mistyrose",
- "lightcyan", "lavender"),
- legend=colnames(deaths), ylim=c(0,80))
- title(main="Death Rates in Virginia", font.main=4)
-
-