[R] Multiple palettes on single plot don't get rendered when I use dev.copy2pdf

peter dalgaard pdalgd at gmail.com
Wed Dec 12 10:10:59 CET 2012


On Dec 12, 2012, at 01:48 , arun wrote:

> Hi,
> Try this:
>  pdf("broke.pdf")
>  palette(rainbow(6))
>  plot(x=x1,y=y1,col=y1,xlim=c(-10,20))
>  palette(heat.colors(6))
>  points(x=x2,y=y2,col=y2)
>  dev.off()
> A.K.

Yep. Notice though that this is not specific to dev.copy2pdf, the same effect happens if you just resize the the screen device. Seems like palette changes are not recorded in the display list. Not sure whether that is by omission or by design.


-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com




More information about the R-help mailing list