I would like to draw some lines across the boxplots produced by base R (specifically, a line at group means, then bounds at ±sqrt(2)*CI). I've found a way to draw dots at the group means, to wit:
...but I'm getting stymied by finding the width of the boxes. The documentation is about three layers deep, and I've tried many combinations of the bxt pars, to no avail.
If it helps, you can see the docs for boxplot which leads to bxp, which has options for both pars() (listed on the aforementioned bxp page) and par(). Some of these set values, some retrieve values, some do both, but I'm having a bit of trouble figuring out which is which.
By default the boxes are drawn at 1:n where n is the number of groups. By setting the boxwex parameter in the call to boxplot() you override the scaling which boxplot() normally does, so you can know the widths of the boxes.