bxp {base} | R Documentation |
bxp
draws box plots based on the given summaries in z
.
It is usually called from within boxplot
, but can be
invoked directly.
bxp(z, notch = FALSE, width = NULL, varwidth = FALSE, outline = TRUE,
notch.frac = 0.5, boxwex = 0.8, border = par("fg"), col = NULL,
log = "", pars = NULL, frame.plot = axes, horizontal = FALSE, add = FALSE,
at = NULL, show.names=NULL, ...)
z |
a list containing data summaries to be used in constructing
the plots. These are usually the result of a call to
|
notch |
if |
width |
a vector giving the relative widths of the boxes making up the plot. |
varwidth |
if |
outline |
if |
boxwex |
a scale factor to be applied to all boxes. When there are only a few groups, the appearance of the plot can be improved by making the boxes narrower. |
notch.frac |
numeric in (0,1). When |
border |
character, the color of the box borders. Is recycled for multiple boxes. |
col |
character; the color within the box. Is recycled for multiple boxes |
log |
character, indicating if any axis should be drawn in
logarithmic scale, as in |
frame.plot |
logical, indicating if a “frame”
( |
horizontal |
logical indicating if the boxplots should be
horizontal; default |
add |
logical, if true add boxplot to current plot. |
at |
numeric vector giving the locations where the boxplots
should be drawn, particularly when |
show.names |
Set to |
pars , ... |
Graphical parameters can be passed as arguments to
this function, either as a list ( |
An invisible vector, actually identical to the at
argument,
with the coordinates ("x" if horizontal is false, "y" otherwise) of
box centers, useful for adding to the plot.
set.seed(753)
str(bx.p <- boxplot(split(rt(100, 4), gl(5,20))))
op <- par(mfrow= c(2,2))
bxp(bx.p, xaxt = "n")
bxp(bx.p, notch = TRUE, axes = FALSE, pch = 4)
bxp(bx.p, notch = TRUE, col= "lightblue", frame= FALSE, outl= FALSE,
main = "bxp(*, frame= FALSE, outl= FALSE)")
bxp(bx.p, notch = TRUE, col= "lightblue", border="red", ylim = c(-4,4),
pch = 22, bg = "green", log = "x", main = "... log='x', ylim=*")
par(op)
op <- par(mfrow= c(1,2))
data(PlantGrowth)
## single group -- no label
boxplot(weight~group,data=PlantGrowth,subset=group=="ctrl")
bx<-boxplot(weight~group,data=PlantGrowth,subset=group=="ctrl",plot=FALSE)
## with label
bxp(bx,show.names=TRUE)
par(op)