Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You apparently wanted just a vertical version, so I took the panel.bwplot code, stripped out all the non-essentials such as the box and the cap, and set horizontal=FALSE in the arguments and created a panel.tuftebxp function. Also set the cex of the points at half of the default. There are still quite a few of options left that could be adjusted to your tastes. The "numeric" factor names for "Time" look sloppy but I figure the "proof of concept" is clear and you can clean up what is important to you:</p> <pre><code>panel.tuftebxp &lt;- function (x, y, box.ratio = 1, box.width = box.ratio/(1 + box.ratio), horizontal=FALSE, pch = box.dot$pch, col = box.dot$col, alpha = box.dot$alpha, cex = box.dot$cex, font = box.dot$font, fontfamily = box.dot$fontfamily, fontface = box.dot$fontface, fill = box.rectangle$fill, varwidth = FALSE, notch = FALSE, notch.frac = 0.5, ..., levels.fos = if (horizontal) sort(unique(y)) else sort(unique(x)), stats = boxplot.stats, coef = 1.5, do.out = TRUE, identifier = "bwplot") { if (all(is.na(x) | is.na(y))) return() x &lt;- as.numeric(x) y &lt;- as.numeric(y) box.dot &lt;- trellis.par.get("box.dot") box.rectangle &lt;- trellis.par.get("box.rectangle") box.umbrella &lt;- trellis.par.get("box.umbrella") plot.symbol &lt;- trellis.par.get("plot.symbol") fontsize.points &lt;- trellis.par.get("fontsize")$points cur.limits &lt;- current.panel.limits() xscale &lt;- cur.limits$xlim yscale &lt;- cur.limits$ylim if (!notch) notch.frac &lt;- 0 #removed horizontal code blist &lt;- tapply(y, factor(x, levels = levels.fos), stats, coef = coef, do.out = do.out) blist.stats &lt;- t(sapply(blist, "[[", "stats")) blist.out &lt;- lapply(blist, "[[", "out") blist.height &lt;- box.width if (varwidth) { maxn &lt;- max(table(x)) blist.n &lt;- sapply(blist, "[[", "n") blist.height &lt;- sqrt(blist.n/maxn) * blist.height } blist.conf &lt;- if (notch) sapply(blist, "[[", "conf") else t(blist.stats[, c(2, 4), drop = FALSE]) ybnd &lt;- cbind(blist.stats[, 3], blist.conf[2, ], blist.stats[, 4], blist.stats[, 4], blist.conf[2, ], blist.stats[, 3], blist.conf[1, ], blist.stats[, 2], blist.stats[, 2], blist.conf[1, ], blist.stats[, 3]) xleft &lt;- levels.fos - blist.height/2 xright &lt;- levels.fos + blist.height/2 xbnd &lt;- cbind(xleft + notch.frac * blist.height/2, xleft, xleft, xright, xright, xright - notch.frac * blist.height/2, xright, xright, xleft, xleft, xleft + notch.frac * blist.height/2) xs &lt;- cbind(xbnd, NA_real_) ys &lt;- cbind(ybnd, NA_real_) panel.segments(rep(levels.fos, 2), c(blist.stats[, 2], blist.stats[, 4]), rep(levels.fos, 2), c(blist.stats[, 1], blist.stats[, 5]), col = box.umbrella$col, alpha = box.umbrella$alpha, lwd = box.umbrella$lwd, lty = box.umbrella$lty, identifier = paste(identifier, "whisker", sep = ".")) if (all(pch == "|")) { mult &lt;- if (notch) 1 - notch.frac else 1 panel.segments(levels.fos - mult * blist.height/2, blist.stats[, 3], levels.fos + mult * blist.height/2, blist.stats[, 3], lwd = box.rectangle$lwd, lty = box.rectangle$lty, col = box.rectangle$col, alpha = alpha, identifier = paste(identifier, "dot", sep = ".")) } else { panel.points(x = levels.fos, y = blist.stats[, 3], pch = pch, col = col, alpha = alpha, cex = cex, identifier = paste(identifier, "dot", sep = ".")) } panel.points(x = rep(levels.fos, sapply(blist.out, length)), y = unlist(blist.out), pch = plot.symbol$pch, col = plot.symbol$col, alpha = plot.symbol$alpha, cex = plot.symbol$cex*0.5, identifier = paste(identifier, "outlier", sep = ".")) } bwplot(weight ~ Diet + Time + Chick, data=cw, panel= function(x,y, ...) panel.tuftebxp(x=x,y=y,...)) </code></pre> <p><img src="https://i.stack.imgur.com/UFPUq.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload