Bug 17348 - Iconsistent transparency between graphics devices
Summary: Iconsistent transparency between graphics devices
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R 3.3.*
Hardware: ix86 (32-bit) Windows 64-bit
: P5 minor
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2017-10-05 12:13 UTC by Arne Løftingsmo
Modified: 2017-10-24 10:47 UTC (History)
1 user (show)

See Also:


Attachments
Ouput from windows device (2.48 KB, image/png)
2017-10-05 12:13 UTC, Arne Løftingsmo
Details
Screen capture of pdf output (7.90 KB, image/png)
2017-10-05 12:14 UTC, Arne Løftingsmo
Details
Screen capture of emf output (10.67 KB, image/png)
2017-10-05 12:14 UTC, Arne Løftingsmo
Details
PDF file (4.67 KB, application/pdf)
2017-10-06 08:45 UTC, Arne Løftingsmo
Details
EMF file (11.74 KB, image/x-emf)
2017-10-06 08:45 UTC, Arne Løftingsmo
Details
test.pdf viewed with xpdf (on Ubuntu 14.04) (18.31 KB, image/png)
2017-10-08 23:08 UTC, Paul Murrell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arne Løftingsmo 2017-10-05 12:13:33 UTC
Created attachment 2295 [details]
Ouput from windows device

Plotting transparent rectangles without borders produces a mesh where their borders overlap for emf and pdf devices. No borders are visible only when plotting to windows device, which should be the correct output.

Example:

```
# Coordinates for mesh of rectangles
x0 <- rep(0:9, times = 10)
x1 <- rep(1:10, times = 10)

y0 <- rep(0:9, each = 10)
y1 <- rep(1:10, each = 10)

# Plot to windows device
plot(1,1, ylim=c(0,10), xlim=c(0,10))
rect(x0, y0, x1, y1, col = '#0000007F', border = NA)

# Plot do pdf device
pdf(file='test.pdf')
plot(1,1, ylim=c(0,10), xlim=c(0,10))
rect(x0, y0, x1, y1, col = '#0000007F', border = NA)
dev.off()

# Plot do emf device
emf(file='test.emf', emfPlus=TRUE)
plot(1,1, ylim=c(0,10), xlim=c(0,10))
rect(x0, y0, x1, y1, col ='#0000007F', border = NA)
dev.off()
```
Comment 1 Arne Løftingsmo 2017-10-05 12:14:15 UTC
Created attachment 2296 [details]
Screen capture of pdf output
Comment 2 Arne Løftingsmo 2017-10-05 12:14:45 UTC
Created attachment 2297 [details]
Screen capture of emf output
Comment 3 Paul Murrell 2017-10-06 02:05:00 UTC
I believe what you are seeing (in PDF at least) is a (not uncommon) PDF viewer glitch, though your PDF screen cap is more severe than I have seen before.  I see something similar, though much less pronounced using evince, but I see no grid at all using xpdf.  What PDF viewer are you using ?

I have no experience with viewing EMF, but the faint grid I see in your screen cap looks similar to what I see in evince for the PDF version.

For the record, the Cairo screen device produces a clean result (like your Windows result).
Comment 4 Arne Løftingsmo 2017-10-06 08:45:14 UTC
Created attachment 2298 [details]
PDF file
Comment 5 Arne Løftingsmo 2017-10-06 08:45:30 UTC
Created attachment 2299 [details]
EMF file
Comment 6 Arne Løftingsmo 2017-10-06 09:08:43 UTC
I have added my pdf and emf file output. The pdf screen capture is from Adobe Acrobat Reader DC 2017 Release (version 17.012.20098.44270).
Comment 7 Paul Murrell 2017-10-08 23:08:35 UTC
Created attachment 2301 [details]
test.pdf viewed with xpdf (on Ubuntu 14.04)

Thanks for your PDF - I have attached what it looks like for me when viewed with xpdf
Comment 8 Arne Løftingsmo 2017-10-24 10:47:20 UTC
xpdf (Ubuntu 14.04) seems to produce the a correct output whereas Adobe Acrobat (Windows 7, version 2017) renders a mesh on screen. So the problem is with PDF viewers rather than with grDevice in R. The EMF file has the same mesh artifact in Office applications (including Microsoft Office 2010 EMF viewer), but also that may be due to poor rendering rather than erroneous output.