Director, Beracah Yankama
2004-Nov-30 20:36 UTC
[R] bitmap (blank image) plot rendering without X11
Hi, I am trying to generate plots on our unix (no X) server to be included in our web-pages -> specifically pngs. Without X, png() obviously doesn't work, so I have been trying to define the graphics print device bitmap as described in the help: > bitmap(file="plot.png", type = "png256", height = 6, width=6,res=72) > pie(c(12,5)) > dev2bitmap(file="plot.png", type = "png256", height = 6, width = 6,res=72) I end up with "plot.png" as a nonzero png file, but it is always blank... I have gs 6.51 installed & R_GSCMD=/usr/bin/gs set. generating Rplot.ps; pstoimg -antialias (or pstopnm) would also be an acceptable solution if I knew how to control the size of the generated image, or if the ps generated by R was consistently compatible with pstopnm. (ps2ps causes me to lose parts of the image).. So I am asking know-alls of R... if they know of a solution? We are generating thousands of images, so work on a windows or slower machine with X is not really an option... any help much appreciated! Beracah -- Beracah Yankama Director, StudentsReview StudentsReview.com beracah at studentsreview.com
"Director, Beracah Yankama" <beracah at studentsreview.com> writes:> Hi, > I am trying to generate plots on our unix (no X) server to be included > in our web-pages -> specifically pngs. > > Without X, png() obviously doesn't work, so I have been trying to > define the graphics print device bitmap as described in the help: > > > bitmap(file="plot.png", type = "png256", height = 6, width=6,res=72) > > pie(c(12,5)) > > dev2bitmap(file="plot.png", type = "png256", height = 6, width > 6,res=72) > > I end up with "plot.png" as a nonzero png file, but it is always > blank... I have gs 6.51 installed & R_GSCMD=/usr/bin/gs set.Try forgetting the dev2bitmap() line and just terminate the device with dev.off(). -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907