(PR#1881) polygon() draws non-transparent border, erase.screen draws non-transparent border (PR#1881)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Wed, 7 Aug 2002 18:15:51 +0100 (BST)


Follow up.  The reason your example does not work is that par("bg") is
transparent (as the help page warns).  It does work if par(bg="white") is
set.  Plotting a polygon first fills the whole area, then overplots the
border (if both cases, for opaque colours).

On Wed, 7 Aug 2002 ripley@stats.ox.ac.uk wrote:

> On Wed, 7 Aug 2002 oehl_list@gmx.de wrote:
>
> >
> > Dear Brian,
> >
> > thank you for your answer.
> >
> > > There's a bug in GA_Polyline (not Polygon) stemming from the changes to
> > > graphics device internals at 1.4.0, it seems.  It is transparent polylines
> > > one cannot draw, and only on the windows() device.
> > >
> > > You don't give an example for erase.screen: does this need a separate fix?
> >
> > The original call to polygon in erase.screen() did use border=NA. I did not
> > find documentation saying what an NA color means !? Testing a bit, I find
> > rect(border=NA) to interpret it as "tranparent" resp. lty=0. To my understanding
> > erase.screen() rather should also erase the borders in background color AS
> > THE PROTOTYPE DOES (WinS+2000), look at example code below. Thus I vote for
> > changing erase.screen() to use border=0 (zero). If polygon() get's fixed, there
> > is no need to use rect() instead of polygon().
>
> NA is a colour that is the same as "transparent".  Unfortunately, border=0
> for polygon() is documented to mean `do not draw', but that is not what
> happens.  Looks like this needs sorting out.
>
> Thanks for drawing it to our attention.
>
> >
> > Best
> >
> >
> > Jens
> >
> >
> > oldpar <- par(no.readonly=TRUE)
> > par(mar=c(0,0,0,0), oma=c(0,0,0,0))
> > figs <- rbind(
> > c( 0.0, 0.5, 0.0, 1.0)  # left
> > , c( 0.5, 1.0, 0.0, 1.0)  # right
> > )
> > dimnames(figs) <- list(
> > c("left","right" )
> > , c("xlow","xhigh","ylow","yhigh")
> > )
> > screens <- split.screen(figs)
> >
> > par(usr=c(0, 1, 0, 1))
> >
> > #plot a box on border of left screen in some color
> > box(col=5)
> >
> > # now switching to right screen ERASES border of right screen in Prototype
> > (S+2000)
> > # thus the right border of the left box gets deleted
> > screen(2)
> >
> > close.screen(all.screens=TRUE)
> > par(oldpar)

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._