lefthist | R Documentation |
lefthist translates a histogram from along the x-axis to flow along the y-axis - it transposes a histogram.
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
)
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 |
the output from hist but done so invisibly.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.