I have two questions - 1. I am trying to create R png graphs via cron. I have this part working using Xvfb (X virtual frame buffer). One problem that I have, though, is that all the fonts on my graphs get messed up. Anybody have any nija R commands to make all fonts look great? Anybody have any idea how to fix this? So far, no luck on Solaris or Linux making the Xvfb fonts look good. I was thining of sending an e-mail to the Xfree86 org people. Haven't seen anything helpful on google so far. 2. I really like the png solution that I have working, above, except for the fonts. Assumming that I can't get the virtual frame buffer working, I guess I can switch to bitmap devices. One thing I have noticed, though, is that the bitmap files are enormous compared to the png images. Any idea how I could make the bmp images smaller (and create faster?) (One of my R bmp generation files is attached.) Thanks, Tony Tony Vargas Cisco Systems Engineering Computing Services (408) 525-4113 tvargas at cisco.com -------------- next part -------------- my.yugo.Mar.2003.unused.memory <- read.table(file="/auto/solperf/tgu/ActiveParsedFiles/yugo/Mar.2003/unused.memory", sep="=", header=TRUE) names(my.yugo.Mar.2003.unused.memory) attach(my.yugo.Mar.2003.unused.memory) bitmap("/auto/solperf/tgu/Images/Mar.2003/yugo.Mar.2003.freemem.lines.jpg", height = 700, width = 700, type = "png256", res = 50) plot(freemem, xlab = "Time", ylab = "Free Memory Pages Available", main = "yugo's Free Memory Pages Available Mar.2003", type="l", col="red", xaxt = "n") temp <- seq(1, length(Time), by = 144) axis(1, at = temp, labels = as.character(Time[temp]), las = 3) bitmap("/auto/solperf/tgu/Thumbs/Mar.2003/yugo.Mar.2003.freemem.lines.png", height = 350, width = 350, type = "png256", res = 50) plot(freemem, xlab = "Time", ylab = "Free Memory Pages Available", main = "yugo's Free Memory Pages Available Mar.2003", type="l", col="red", xaxt = "n") temp <- seq(1, length(Time), by = 288) axis(1, at = temp, labels = as.character(Time[temp]), las = 3) bitmap("/auto/solperf/tgu/Images/Mar.2003/yugo.Mar.2003.freeswap.lines.jpg", height = 700, width = 700, type = "png256", res = 50) plot(freeswap, xlab = "Time", ylab = "Average # of blocks availalbe for swapping", main = "yugo's Average # of blocks availalbe for swapping Mar.2003", type="l", col="red", xaxt = "n") temp <- seq(1, length(Time), by = 144) axis(1, at = temp, labels = as.character(Time[temp]), las = 3) bitmap("/auto/solperf/tgu/Thumbs/Mar.2003/yugo.Mar.2003.freeswap.lines.png", height = 350, width = 350, type = "png256", res = 50) plot(freeswap, xlab = "Time", ylab = "Average # of blocks availalbe for swapping", main = "yugo's Average # of blocks availalbe for swapping Mar.2003", type="l", col="red", xaxt = "n") temp <- seq(1, length(Time), by = 288) axis(1, at = temp, labels = as.character(Time[temp]), las = 3)
Tony,> that all the fonts on my graphs get messed up. Anybody have > any nija R > commands to make all fonts look great? Anybody have any idea > how to fix > this? So far, no luck on Solaris or Linux making the Xvfb fonts lookI have played with Xvfb and have not seen the same font problem (Mandrake 9.0 for Linux, R 1.6.2) generating png's via CGI (my problems are more with CGI-secure permissions). You mentioned running a cron (batch) job -- do you see the same problem using R interactively (such as an ssh login with X not running)? Perhaps you can provide some lines of your code of your cron script to help the diagnosis? What is specifically messed up with the fonts? Adjusting the pointsize argument in png might help.> is that the bitmap files are enormous compared to the png images. Any > idea how I could make the bmp images smaller (and create > faster?) (One of > my R bmp generation files is attached.)As far as bitmaps go, I think that in general the smaller they are, the less resolution you will have. But even if you are willing to give that up, you might need to delve into ghostscript call options, since my understanding is that what bitmap() uses under Linux (and I presume other X11 device approaches including Solaris). See the code for bitmap(), in particular the gsexe and cmd objects. (I noticed your setting of some arguments like res in your bitmap generation file attachment, but as I guess above, other gs-intrinsic flags may be needed.) Hope that helps, Bill ---------------------------------------- Bill Pikounis, Ph.D. Biometrics Research Department Merck Research Laboratories PO Box 2000, MailDrop RY84-16 126 E. Lincoln Avenue Rahway, New Jersey 07065-0900 USA v_bill_pikounis at merck.com Phone: 732 594 3913 Fax: 732 594 1565> -----Original Message----- > From: Tony Vargas [mailto:tvargas at cisco.com] > Sent: Monday, March 31, 2003 9:23 PM > To: r-help at stat.math.ethz.ch > Subject: [R] Autogenerated png, bitmap images > > > I have two questions - > > 1. I am trying to create R png graphs via cron. I have this > part working > using Xvfb (X virtual frame buffer). One problem that I > have, though, is > that all the fonts on my graphs get messed up. Anybody have > any nija R > commands to make all fonts look great? Anybody have any idea > how to fix > this? So far, no luck on Solaris or Linux making the Xvfb fonts look > good. > > I was thining of sending an e-mail to the Xfree86 org people. > Haven't seen anything helpful on google so far. > > > 2. I really like the png solution that I have working, > above, except for > the fonts. Assumming that I can't get the virtual frame > buffer working, > I guess I can switch to bitmap devices. One thing I have > noticed, though, > is that the bitmap files are enormous compared to the png images. Any > idea how I could make the bmp images smaller (and create > faster?) (One of > my R bmp generation files is attached.) > > Thanks, > > Tony > > Tony Vargas > Cisco Systems > Engineering Computing Services > (408) 525-4113 > tvargas at cisco.com >------------------------------------------------------------------------------
Hi Tony, I looked over the files and I am puzzled why the difference in font sizes. Unfortunately my knowledge about X window configurations is pretty scant. (You mention in the shell script comments that you run the job as root, so I wonder if that makes any difference to X..I doubt it). I recall some threads on X devices and font sizes in the R-help archives, so you may wish to consult there. You also suggested an XFree86 list, and I think that would be a good idea to post. But as a potential workaround thru R, perhaps the cex settings (see ?par), like cex, cex.axis, cex.lab, cex.main, and cex.sub could help you adjust the font-sizes down to what you would like.> > Adjusting the pointsize argument in png might help. > > I've played with this a little. Any specific value you suggest?I use pointsize = 10 in my set-up for png() with Xvfb, which is somewhat different from the default (12). It is hard to judge if that will reduce your size enough. Hope that helps, Bill> -----Original Message----- > From: Tony Vargas [mailto:tvargas at cisco.com] > Sent: Tuesday, April 01, 2003 2:40 PM > To: Pikounis, Bill > Cc: r-help at stat.math.ethz.ch > Subject: RE: [R] Autogenerated png, bitmap images > > > Bill, > > Thanks for the response. Comments in-line > > Tony > > Tony Vargas > Cisco Systems > Engineering Computing Services > (408) 525-4113 > tvargas at cisco.com > > On Tue, 1 Apr 2003, Pikounis, Bill wrote: > > > Tony, > > > > > that all the fonts on my graphs get messed up. Anybody have > > > any nija R > > > commands to make all fonts look great? Anybody have any idea > > > how to fix > > > this? So far, no luck on Solaris or Linux making the > Xvfb fonts look > > > > I have played with Xvfb and have not seen the same font > problem (Mandrake > > 9.0 for Linux, R 1.6.2) generating png's via CGI (my > problems are more with > > CGI-secure permissions). You mentioned running a cron > (batch) job -- do you > > see the same problem using R interactively (such as an ssh > login with X not > > running)? Perhaps you can provide some lines of your code > of your cron > > script to help the diagnosis? What is specifically messed > up with the > > fonts? > > Files are attached. One of the files shows a creation via > cron, one via an ssh sesssion. > Any idea how to make them look the exact same? The script > that I use to > start Xvbg (and call R) is also attached. > > > > > Adjusting the pointsize argument in png might help. > > I've played with this a little. Any specific value you suggest? > > > > > > > is that the bitmap files are enormous compared to the png > images. Any > > > idea how I could make the bmp images smaller (and create > > > faster?) (One of > > > my R bmp generation files is attached.) > > > > As far as bitmaps go, I think that in general the smaller > they are, the less > > resolution you will have. But even if you are willing to > give that up, you > > might need to delve into ghostscript call options, since my > understanding is > > that what bitmap() uses under Linux (and I presume other X11 device > > approaches including Solaris). See the code for bitmap(), > in particular the > > gsexe and cmd objects. (I noticed your setting of some > arguments like res in > > your bitmap generation file attachment, but as I guess above, other > > gs-intrinsic flags may be needed.) > > > > Hope that helps, > > Bill------------------------------------------------------------------------------