Skip to content
Prev 30561 / 63421 Next

alpha transparency crashes R

Hi
Deepayan Sarkar wrote:
Grid runs laughing from your puny accusations!
This will tickle the problem too:

plot(rnorm(n), rnorm(n), col = rgb(0, 0, 0, alpha = runif(n)), pch = 19)

The issue appears to be in the PDF device driver, which has a fixed-size
integer array called pd->pos and those larger examples are generating
"too many" different alpha values so that we end up assigning values
out-of-range for that array.

The simple fix is to bump up the initial size of the pd->pos array, but
there is some heuristic code in devPS.c (PDF_NewPage) that appears to be
trying to resize the array on-the-fly based on how many pages are being
generated, so perhaps this needs a bit more thought.

Thanks for the bug report!

Paul