Here is the ggplot answer ggplot . Starting with Sven's answer
interval <- c(4.5, 8.2) myd <- within(myd, group <- myv >= interval[1] & myv <= interval[2])
Ggplot code will be
ggplot(myd, aes(x = 0, y = myv)) + geom_boxplot(fill = "lightgreen") + annotate("rect", ymin = interval[1], ymax = interval[2], xmin = -1/2, xmax = 1/2, fill = "blue", alpha = 0.25) + geom_point(data=myd[!myd$group,], shape = 21, colour = "black", fill = "orange") + scale_x_continuous("", breaks = NULL) + theme_bw()
The box itself is straightforward. A bluish rectangle is an abstract. Dots are drawn on top of this, restricting the data to only those outside the range (as calculated for group ). scale_x_continuous eliminates the axial notation of x, and theme_bw() gives a simpler background and grid.

You can increase the number of points by pointing size to the geom_point level, and other settings are also possible.
source share