[R] coplot with png: disappearing grid lines

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Dec 30 09:15:34 CET 2004


The lines are there for Uwe and for me: perhaps your PNG viewer is 
defective, possibly your graphics hardware has a buggy driver.

File-Save As-png/jpeg/bmp runs png() internally, so the exact same code is 
used.  As it is when savePlot() is used, which might be a workaround for 
you.

On Wed, 29 Dec 2004, bogdan romocea wrote:

> Dear useRs,
>
> When I use coplot() and output to png/jpeg/bmp, the grid lines from
> the scatter plots disappear. If I output to pdf() the grid lines are
> there, however I can't use it - I have many points, and the resulting
> PDF file is large and very slow to open and scroll through. (By the
> way, if I click File-Save As-png/jpeg/bmp from Rgui.exe, the grid
> lines are preserved - but I need to use code.)
>
> With coplot(), is there a way to:
> 1. Keep the grid lines in the scatter plots when exporting output to
> png(), and perhaps change their color?
> 2. Specify the number of grid lines to be drawn on the x and y axes?
>
> I'm running R 2.0.0 on Win XP.
>
> Thank you,
> b.
>
> a <- rnorm(50000)
> b <- rnorm(50000)
> c <- rnorm(50000)
> #pdf("test.pdf",height=9,width=12)
> png("test.png",height=900,width=1200)
> coplot(a ~ b | c,pch=20,col="navy",
> 	bar.bg=c(num=gray(0.8),fac=grey(0.95)))
> dev.off()
>
> ______________________________________________
> R-help at 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
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list