From mwtoews at sfu.ca  Thu Dec  6 22:50:20 2007
From: mwtoews at sfu.ca (mwtoews at sfu.ca)
Date: Thu,  6 Dec 2007 22:50:20 +0100 (CET)
Subject: [Rd] End of whiskers of boxplots are repeated on PDF device
	(PR#10499)
Message-ID: <20071206215020.230F6283461C@mail.pubhealth.ku.dk>

Full_Name: Michael Toews
Version: 2.61
OS: WinXP SP2
Submission from: (NULL) (142.58.206.114)


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))
pdf("test.pdf")
plot(dat)
dev.off()

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--

Version:
 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

Locale:
LC_COLLATE=English_Canada.1252;LC_CTYPE=English_Canada.1252;LC_MONETARY=English_Canada.1252;LC_NUMERIC=C;LC_TIME=English_Canada.1252

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



[Rd] End of whiskers of boxplots are repeated on PDF device (PR#10499)
mwtoews at sfu.ca