Re: [R] using alpha transparency for lines in levelplot - SUMMARY

2007-03-29 Thread Kevin Wright
I reported a similar issue with Adobe Reader in a thread starting here:
http://tolstoy.newcastle.edu.au/R/e2/devel/06/10/0706.html

K Wright



On 3/27/07, Michael Sumner [EMAIL PROTECTED] wrote:
 Hello, thanks to Deepayan Sarkar for sorting me out on this one.

 The problem with transparent lines affecting region colour in lattice
 plot appears
 when using Adobe Reader (v 8 in my case). I've only viewed the file on
 Windows XP.

 I've tried using Foxit Reader to view the file and there's no problem.

 Cheers, Mike.

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] using alpha transparency for lines in levelplot

2007-03-26 Thread Deepayan Sarkar
On 3/26/07, Michael Sumner [EMAIL PROTECTED] wrote:
 Hello, I'm having trouble with using the alpha channel for transparency
 with lines with lattice levelplots.

 If I use transparency via the alpha argument to rgb to overplot lines on
 levelplot the transparent colour affects all of the region colours in the
 plot.

I don't understand what you are trying to say. Here's a modified
version of your code:


--
## panel function to add lines with grey(0.3)
my.panel - function(...) {
panel.xyplot(1:60, runif(60, 1, 60), type = l, lwd = 3,
 col = grey(0.3))
panel.contourplot(...);
panel.xyplot(1:60, runif(60, 1, 60), type = l, lwd = 3,
 col = grey(0.3))
}

## panel function to add lines with grey transparency
my.paneltransp - function(...) {
   panel.xyplot(1:60, runif(60, 1, 60), type = l, lwd = 3,
col = rgb(0.3, 0.3, 0.3, 0.5))
   panel.contourplot(...)
   panel.xyplot(1:60, runif(60, 1, 60), type = l, lwd = 3,
col = rgb(0.3, 0.3, 0.3, 0.5))
}

pdf(alpha.pdf, version = 1.4)

## this works fine
levelplot(z~x+y, xy, panel = my.panel)

## this doesn't?
levelplot(z~x+y, xy, panel = my.paneltransp)

dev.off()
--

and the resulting 2-page PDF file is at

http://dsarkar.fhcrc.org/R/alpha.pdf

I don't see any evidence of transparency in the 'region' colors (the
lines behind the level plot never show up). Are you sure whatever you
are seeing is not an artifact of your display application?

Deepayan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] using alpha transparency for lines in levelplot

2007-03-26 Thread Michael Sumner
Deepayan Sarkar wrote:

 I don't understand what you are trying to say. Here's a modified
 version of your code:



Sorry, it's not that the transparency affects the plot regions but the 
colour of the lines darkens the region
colours. I.e. with grey lines the regions are greyed. In your PDF the 
regions are greyed (darker)
in both plots than the colours I see with the usual lattice colour scheme.
Do you notice any difference between the region colours of the plots if 
you write
them to separate files?

If not it must be my viewer.

Cheers, Mike.

 --
 ## panel function to add lines with grey(0.3)
 my.panel - function(...) {
panel.xyplot(1:60, runif(60, 1, 60), type = l, lwd = 3,
 col = grey(0.3))
panel.contourplot(...);
panel.xyplot(1:60, runif(60, 1, 60), type = l, lwd = 3,
 col = grey(0.3))
 }

 ## panel function to add lines with grey transparency
 my.paneltransp - function(...) {
   panel.xyplot(1:60, runif(60, 1, 60), type = l, lwd = 3,
col = rgb(0.3, 0.3, 0.3, 0.5))
   panel.contourplot(...)
   panel.xyplot(1:60, runif(60, 1, 60), type = l, lwd = 3,
col = rgb(0.3, 0.3, 0.3, 0.5))
 }

 pdf(alpha.pdf, version = 1.4)

 ## this works fine
 levelplot(z~x+y, xy, panel = my.panel)

 ## this doesn't?
 levelplot(z~x+y, xy, panel = my.paneltransp)

 dev.off()
 --

 and the resulting 2-page PDF file is at

 http://dsarkar.fhcrc.org/R/alpha.pdf

 I don't see any evidence of transparency in the 'region' colors (the
 lines behind the level plot never show up). Are you sure whatever you
 are seeing is not an artifact of your display application?

 Deepayan



__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] using alpha transparency for lines in levelplot - SUMMARY

2007-03-26 Thread Michael Sumner
Hello, thanks to Deepayan Sarkar for sorting me out on this one.

The problem with transparent lines affecting region colour in lattice 
plot appears
when using Adobe Reader (v 8 in my case). I've only viewed the file on 
Windows XP.

I've tried using Foxit Reader to view the file and there's no problem.

Cheers, Mike.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.