Skip to content

MetaPost device

2 messages · Vidhyanath Rao, Brian Ripley

#
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.

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.
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.] 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 :-).




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Sat, 6 May 2000, Vidhyanath Rao wrote:

            
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.)
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?
(Dreadfully, as the examples in the LaTeX Graphics Companion show.  Some of
us care about graphics quality.)
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?).