[Rd] End of whiskers of boxplots are repeated on PDF device (PR#10499)

mwtoews at sfu.ca mwtoews at sfu.ca
Thu Dec 6 22:50:20 CET 2007

Full_Name: Michael Toews
Version: 2.61
Submission from: (NULL) (

Using boxplot on a PDF device with more than one group (or boxes) produces
multiple (and overlain) 1st and 3rd quartile ticks. There are exactly the
multiple of boxplot groups as there are of each 1st and 3rd quartile ticks for
each boxplot (drawn as a horizontal line at the end of each boxplot), which is
(groups^2)x2 tick marks in total drawn for the device region.

For example, a device with 4 boxplots:
dat <- data.frame(f=factor(rep(1:4, 10)), x=rnorm(40))

Since the ticks are overlain, the problem is not apparent when viewed in a PDF
reader, but if one were to open the PDF in either CorelDraw or Adobe
Illustrator[*], it is clear that there are 4 ticks for the 1st and 3rd quartile
marks. This example produces (4^2)x32=64 marks, which is 58 too many. In other
examples that use 86 boxplots, there are (86^2)x2=14792 ticks, of which only
2x86 are needed, the rest are redundant.

[*] I'm not familiar with any OSS capable of editing PDFs, however you can see
the tick marks in the PDF file through any text editor on lines 54-61, 77-84,
100-107, and 123-130. The tick marks alternate from 1st to 3rd each of the four
times, so deleting the bottom 6 lines in each group removes the redundancy.

I have also tested the example using the postscript device, but it seems fine
(the skeleton of the boxplots appear to be compound paths, so are drawn very
differently from a low-level graphics standpoint).

--please do not edit the information below--

 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 6.1
 year = 2007
 month = 11
 day = 26
 svn rev = 43537
 language = R
 version.string = R version 2.6.1 (2007-11-26)

Windows XP (build 2600) Service Pack 2.0


Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices, package:utils,
package:datasets, package:methods, Autoloads, package:base

More information about the R-devel mailing list