plot.histogram             package:base             R Documentation

_P_l_o_t _H_i_s_t_o_g_r_a_m_s

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

     These are methods for objects of class `"histogram"', typically
     produced by `hist(...)'.  See that page for information about the
     components of `x'.

     `lines.histogram(*)' is the same as `plot.histogram(*, add =
     TRUE)'.

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

     plot.histogram(x, freq = equidist, col = NULL, border = par("fg"),
                    lty = NULL, main = paste("Histogram of", x$xname),
                    xlim = range(x$breaks), ylim = range(y, 0),
                    xlab = x$xname, ylab, axes = TRUE, labels = FALSE,
                    add = FALSE, ...)

     lines.histogram(x, ...)

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

       x: a `histogram' object, or a list with components
          `intensities', `mid', etc, see `hist'.

    freq: logical; if `TRUE', the histogram graphic is to present a
          representation of frequencies, i.e, `x$counts'; if `FALSE',
          relative frequencies (``probabilities''), i.e.,
          `x$intensities', are plotted.  The default is true for
          equidistant `breaks' and false otherwise.

     col: a colour to be used to fill the bars.  The default of `NULL'
          yields unfilled bars.

  border: the color of the border around the bars.

     lty: the line type used for the bars, see also `lines'.

xlim, ylim: the range of x and y values with sensible defaults.

main, xlab, ylab: these arguments to `title' have useful defaults here.

    axes: logical, indicating if axes should be drawn.

  labels: logical or character.  Additionally draw labels on top of
          bars, if not `FALSE'; if `TRUE', draw the counts or rounded
          intensities; if `labels' is a `character', draw itself.

     add: logical.  If `TRUE', only the bars are added to the current
          plot.  This is what `lines.histogram(*)' does.

     ...: further graphical parameters to `title' and `axis'.

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

     `hist', `stem', `density'.

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

     data(women)
     str(wwt <- hist(women$weight, nc= 7, plot = FALSE))
     plot(wwt, labels = TRUE) # default main & xlab using wwt$xname
     plot(wwt, border = "dark blue", col = "light blue",
          main = "Histogram of 15 women's weights", xlab = "weight [pounds]")

     ## Fake "lines" example, using non-default labels:
     w2 <- wwt; w2$counts <- w2$counts - 1
     lines(w2, col = "Midnight Blue", labels = ifelse(w2$counts, "> 1", "1"))

