[R] Autogenerated png, bitmap images

Tony Vargas tvargas at cisco.com
Tue Apr 1 21:39:55 CEST 2003


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
>
> ----------------------------------------
> 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
> >
>
>
> ------------------------------------------------------------------------------
> Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.
>
> ==============================================================================
>
>
-------------- next part --------------
#!/bin/bash
#Shell script to generate nightly tgu graphs

#Need to setup a virtual X11 frame buffer so that R can print image files.  Will not work without.  In addition, this is why graph generation needs to be run as root - so that the frame buffer can be created

TERM="vt100"
XVFB_HOME="/nfs/ecs/perf/opt/tgu_perf/XVFB"
export TERM
export XVFB_HOME



#Updated font path - so graphs look better
$XVFB_HOME/Xvfb :101 -co $XVFB_HOME/rgb -fp /usr/openwin/lib/X11/fonts/F3bitmaps/,/usr/openwin/lib/X11/fonts/Type1/,/usr/openwin/lib/X11/fonts/Speedo/,/usr/openwin/lib/X11/fonts/misc/,/usr/openwin/lib/X11/fonts/75dpi/,/usr/openwin/lib/X11/fonts/100dpi/ -sp /usr/X/server/etc/SecurityPolicy &


export DISPLAY=localhost:101:0


AppBaseDir="/nfs/ecs/perf/opt/tgu_perf/bin"
BaseDir="/auto/solperf/tgu"
BaseRFileDir="$BaseDir/RFileBase"
BaseImageDir="$BaseDir/Images"
BaseThumbsDir="$BaseDir/Thumbs"

Month='/bin/date +"%h"'
Year='/bin/date +"%Y"'
Day='/bin/date +"%d"'
Month_Year_Combo=`/bin/date +"%h.%Y"`


#Create a directory for every month for both images, thumbnails and RFiles - if do this, no need to do a rm every night

if [ ! -d "$BaseRFileDir/$Month_Year_Combo" ] ; then 
     mkdir $BaseRFileDir/$Month_Year_Combo
     mkdir $BaseThumbsDir/$Month_Year_Combo
     mkdir $BaseImageDir/$Month_Year_Combo
fi
 
#Generate R config files

$AppBaseDir/tgu_r_mon_gen

cd $BaseRFileDir/$Month_Year_Combo
for i in `ls`; do
   /usr/cisco/bin/R < $i --no-save --silent 

 done



#####Stuff below is just junk

##$XVFB_HOME/Xvfb :101 -co $XVFB_HOME/rgb -fp $XVFB_HOME/fonts/misc/,$XVFB_HOME/fonts/Speedo/,$XVFB_HOME/fonts/Type1/,$XVFB_HOME/fonts/75dpi/,$XVFB_HOME/fonts/100dpi/ -sp $XVFB_HOME/SecurityPolicy &

#$XVFB_HOME/Xvfb :101 -co $XVFB_HOME/rgb -fp /usr/X/lib/X11/fonts/TrueType/,/usr/X/lib/X11/fonts/Type1/,/usr/X/lib/X11/fonts/Type3/,/usr/X/lib/X11/fonts/100dpi/,/usr/X/lib/X11/fonts/75dpi/,/usr/X/lib/X11/fonts/CSL/,/usr/X/lib/X11/fonts/misc/ -sp $XVFB_HOME/SecurityPolicy &


More information about the R-help mailing list