lefthist: lefthist draws a histogram up the y-axis

View source: R/cpueplots.R

lefthistR Documentation

lefthist draws a histogram up the y-axis

Description

lefthist translates a histogram from along the x-axis to flow along the y-axis - it transposes a histogram.

Usage

lefthist(
  x,
  bins = 25,
  mult = 1.025,
  col = 2,
  lwd = 1,
  width = 0.9,
  border = 1,
  xinc = 1,
  yinc = NA,
  title = "",
  xlabel = "Frequency",
  ylabel = "",
  cex = 1,
  textout = FALSE,
  hline = NA
)

Arguments

x

a vector of the data to be plotted

bins

the breaks from the histogram, can be a single number of a sequence of values; defaults to 25

mult

the multiplier for the maximum count in the histogram. Becomes the upper limit of teh x-axis.

col

the colour for the histogram polygons; default = 2

lwd

the line width for each polygon; default = 1

width

the width of each bar in teh histogram; default = 0.9

border

the colour for the border line; default = 1 = black

xinc

the step size for the x-axis (counts) labels; default= NA, which means the increment will equal the bin width.

yinc

the step size for the y-axis (breaks) labels; default= 1.

title

the title for the left-histogram; defaults to ""

xlabel

the xlab; defaults to ""

ylabel

the ylab; defaults to "Frequency"

cex

the size of text in teh plot. defaults = 1.0

textout

prints input data range to console; default = FALSE

hline

if this has a value a horizontal line will be plotted; default = NA

Value

the output from hist but done so invisibly.

Examples

dat <- rnorm(1000,mean=5,sd=1)
dev.new(width=6,height=4,noRStudioGD = TRUE)
par(mai=c(0.45,0.45,0.05,0.05))
lefthist(dat)
lefthist(dat,textout=TRUE,width=0.8,border=3)

haddonm/rforcpue documentation built on Oct. 12, 2024, 11:55 p.m.