[R] MetaPost device

Prof Brian D Ripley ripley at stats.ox.ac.uk
Sun May 7 17:40:00 CEST 2000


On Sat, 6 May 2000, Vidhyanath Rao wrote:

> Several weeks back I raised the question of implementing a MetaPost
> device. I finally got some time to look at the source code of other
> device drivers in R. Everything else is easy except for text. It seems
> that R wants the font metrics information from its device drivers.
> PicTeX driver gets around this by allowing only four fonts and
> hard-coding the tfm info into itself. This seems rather draconian. It
> would mean, for example, that any mathematical typesetting will stick
> out. As my interest was soley for using R's graphs in TeX files and get
> both dvi and pdf outputs painlessly from, a MetaPost driver for R seems
> to be more trouble than is worth.

Yes, but pictex is the one exception: it is a third-party driver and little
used (since it was pretty broken and no one complained).  Look at the XFig
driver (in R-devel snapshots for a much better model).  (BTW, I don't think
you can get DVI from MetaPost: the DVI model is not rich enough.)

> The major problem seems to be that R considers the device drivers to be
> fairly limited in terms of typesetting. MetaPost is the other extreme.

Not at all. R's drivers are completely sufficient for R's graphics model,
except for the pictex one.  R's model only allows one font family at a
time, but that suffices for a single graph, surely?

> It seems to me that it would be better to extract information from R and
> produce MetaPost input. [MetaPost already has a graph package that does
> 2d graphing.] 

(Dreadfully, as the examples in the LaTeX Graphics Companion show.  Some of
us care about graphics quality.)

>The only problem is that it is not always clear how to get
> the information out. For example, qqnorm and qqplot are documented as
> returning the list of points that will be plotted. But nothing is said
> concerning qqline and it is still not clear to me if I have to basically
> implement it from scratch (or rather by copying the code). Perhaps this
> is one more thing for the documentation team to take care of :-).

What documentation team is that?

qqline draws a line, not presents you with a list of points (its return
value is invisible(), and qqnorm and qqplot do more than calcualte the list
of points they return.  But I do think that a MetaPost device is the way to
go and not at all difficult if you consider only postscript fonts (and I do
for serious typesetting anyway).  If you want more, then you do need the
font information (from tfms?).

-- 
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list