[R] Font quality in base graphics

Gabor Csardi csardi at rmki.kfki.hu
Wed Jul 16 11:48:28 CEST 2008


Hmmm, I did not follow this thread closely, sorry for that, 
just want to share my 2c. 

If it is about quality, then I create EPS files and use the 
psfrag latex package to replace the PS fonts with TeX's fonts. 

This has the following advantages:
1) The figures have the same font as the text itself. The same 
   size as well. If you resize the figure the fonts stay the same!
2) You can write fancy TeX formulae in the figures. 
3) You can have any font TeX supports. 

Disadvantages:
1) The same as before, if you resize the figure the fonts stay the 
   same! This is quite far from WYSIWYG.
2) You cannot use pdfLaTeX.

I have a little script that automates this for .fig files (this is 
based on figtex, another script that I found somewhere online and 
can't find it any more), and another one for SVG files. So you save 
the file with xfig() or svg() and then the script does everything,
all you have to do is to include it into the .tex file with a 
small custom macro.

Gabor

On Wed, Jul 16, 2008 at 02:25:52AM -0700, Mark Difford wrote:
> 
> Hi willemf,
> 
> Glad to hear that it helped.  Years ago (late-90s) I Linuxed, but have since
> been forced into the Windows environment (where, however, I have the great
> pleasure of being able to use MiKTeX and LyX, i.e. TeX/LaTeX). I therefore
> can't help you further, except to say that I have never had a problem
> controlling font sizes &c to my admittedly very demanding --- some people
> say excessively demanding --- standards (and that's on Windows!). And I have
> never had a problem with labels &c not being where they should be, or of the
> size I want them to be, when I have built the graphic from "scratch." And
> only very rarely have I encountered such problems when using canned graph
> types.
> 
> In brief, what I am saying is that the problem almost certainly lies with
> the way fonts &c are set up on your Linux box. Were this not the case, then
> I can assure you that there would have many and varied sharply worded
> statements on this list relating to the poor quality of R's graphs. And
> there would have been just as many pointed, well-written rebukes, pointing
> that .... Yet there aren't. If you search the archives you will find that a
> good many users migrated to R from other systems because of R's excellent
> graphical subsystems. Look at the graphics in any of the many books now
> published on using R, or that use R to elucidate problems.... Set your mind
> at rest: look at your system setup, and the tools outside R that you are
> using.
> 
> Hope it all works out. OpenOffice is now a very good suite of programs, but
> if you want true quality of output then you really should be TeXing. Check
> it out.
> 
> Bye, Mark.
> 
> 
> willemf wrote:
> > 
> > Mark, your suggestion results in about 75% control over the plot. This is
> > the best that I have managed to get it at, so thank you very much. In
> > Linux you create a X11() device for screen output. Specifying identical
> > device characteristics results in a fair degree of similarity between
> > screen version and EPS version. However in this case, for instance, some
> > labels along the X axis are omitted in the screen version and
> > (thankfullly!) included in the Postscript version. Also, the relative
> > sizes of caption font size and label font size are not identical in the
> > two versions. I have learnt a few things in this exercise, so thanks you
> > very much for the advice.
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Font-quality-in-base-graphics-tp18465608p18483719.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    UNIL DGM



More information about the R-help mailing list