R segments can't handle transparency?
In R (3.0.2 in Windows 7) segments() function can't handle transparency?
dev.new(width=10,height=10)
par(mar=c(0,0,0,0))
x = 1:10
y = 10:1
plot(x,y)
segments(0,0,10,10,col=rgb(0,0,0,0.5))
This should draw a gray line over the plot, but nothing is drawn. Why?
According to grDevices help, ( ?dev.capabilities
)
Most recent devices support semi-transparent colours provided the graphics format does (which PostScript does not). On the other hand, relatively few graphics formats support (fully or semi-) transparent backgrounds: generally the latter is found only in PDF and PNG plots.
Which seems to be right in line with the original questions reported behaviour and the reported response to the filed bug report. (see the comments)
This is a function of how Windows' GDI handles translucency (transparency works just fine, but that colour is not transparent). ...
链接地址: http://www.djcxy.com/p/77476.html上一篇: 打开一个包含ASPX回发结果的弹出窗口
下一篇: R细分市场无法处理透明度?