[R] xfig boxplot (polygon) bug??

e.catchpole@adfa.edu.au
Tue, 13 Feb 2001 03:51:56 -0000

There appears to be a bug in the R xfig() driver.

When I run a simple example, eg

> data(InsectSprays)
> boxplot(count ~ spray, data = InsectSprays, col = "lightgray")

the boxplot is fine. Doing the same thing after

> xfig(file='test.fig')

and then opening in Xfig (ver3.2 patchlevel 2) on my Linux box produces boxplots
where the boxes, although correctly shaded in, have
lost the vertical line that defines the left edge of the box. That is,
they look like

       |                         |
       |                         |
     -----                     -----
          |                   |     |
          |    instead of     |     |
          |                   |     |
     -----                     -----
       |                         |
       |                         |

This doesn't sound serious, but I'm running the result through pdf
postprocessors (mpost, then ppower4), and the result comes out as
triangles instead of boxes!

A simple workaraound, I expect, would be to define the boxes as
5-point polygons rather than 4-point, to force closure (sorry if I'm
not using the right jargon here).

I tried to get a look at the boxplot code to check this out, but

> boxplot

just produces

function (x, ...)
UseMethod("boxplot")

Is there any way I can get at the boxplot code? Or is there another
way out of my problem? I'd be very grateful for any help.

I'll post this as a bug if this is confirmed.

Thanks,
Ted.

Dr E.A. (Ted) Catchpole
School of Maths & Stats                Honorary Senior Research Fellow
University College, UNSW               Institute of Maths & Stats
Australian Defence Force Academy       University of Kent at Canterbury
Canberra, ACT 2600, Australia          Canterbury CT2 7NF, England
e-catchpole at adfa.edu.au                E.A.Catchpole at ukc.ac.uk
www.ma.adfa.edu.au/~eac
fax: +61 2 6268 8886