Learn R Programming

rtemis (version 0.79)

mhist: Histograms

Description

Draws a histogram using lines.

Usage

mhist(x, breaks = "Sturges", measure = c("density", "counts"),
  lwd = 3, xlim = NULL, ylim = NULL, plot.axes = FALSE,
  xaxis = TRUE, yaxis = TRUE, xaxis.line = 0, yaxis.line = 0,
  xlab = NULL, ylab = measure, xaxs = "r", yaxs = "r",
  box = FALSE, grid = FALSE, col = pennCol$lighterBlue,
  horiz = FALSE, main = "", add = FALSE, ...)

Arguments

x

Input vector

breaks

See hist("breaks") Default = "Sturges"

measure

String: "density"(Default), "counts"

lwd

Float: Line width

xlim

Vector, length 2: x-axis limits

ylim

Vector, length 2: y-axis limits

plot.axes

Logical: If TRUE, draws plot axes. Separate from xaxis and yaxis

xaxis

Logical: If TRUE, draws x-axis

yaxis

Logical: If TRUE, draws y-axis

xaxis.line

Float: Number of lines into the margin to position xaxis. See axis("line")

yaxis.line

Float: Number of lines into the margin to position yaxis. See axis("line")

xlab

String: x-axis label

ylab

String: y-axis label

xaxs

String: 'r' (Default): Extends x-axis range by 4 percent at each end, 'i': Does not extend x-axis range

yaxs

String: 'r' (Default): Extends y-axis range by 4 percent at each end, 'i': Does not extend y-axis range

box

Logical: If TRUE, draws a box around plot

grid

Logical: If TRUE, draws a grid

col

Color to use for histogram lines

horiz

Logical: If TRUE, switches x and y axes. Important: Provide all other arguments as if for a non-rotated plot - i.e. xlab will become the y-axis label

main

String: Main title

add

Logical: If TRUE, add histogram to existing plot (Caution: make sure the axes line up!)

...

Additional arguments to be passed to graphics::plot

Details

Using horiz = TRUE, you can draw vertical histograms (as used by mplot3.xym)