[R] Windows metafile

Prof Brian D Ripley ripley at stats.ox.ac.uk
Thu Feb 17 00:29:58 CET 2000


On Tue, 8 Feb 2000, BXC (Bendix Carstensen) wrote:

> Running
> 
> R : Copyright 1999, The R Development Core Team
> Version 0.90.1  (December 15, 1999)
> 
> on NT 4.0 gives me problems with:
> 
> win.metafile(file="./x.emf")
> x <- 1:100/7
> plot(x,cos(x),type="n")
> lines(x,sin(x))
> abline(v=0:15,h=-2:2/2,col=gray(0.8))
> 
> Only labels and titles on axes are in the file.
> No axes or lines of any kind. (I look at the file by 
> inserting it in Word, which is what I need for
> my client). Variations over the theme by using
> type="l" or "p", does not change anything.

Yes, I get that with Word 2000 on NT4, but the problem appears to be in
Word's preview, and definitely the lines are in the file.

1) The Word document prints with all the lines, and looks correct.
2) If you preview in Word and magnify, you can see all the lines.

Interestingly

3) If I copy to the clipboard as a metafile and paste into Word, I
do see the lines, but if I copy the graphics device to a file I do not.

Also

4) I have seen this with metafiles from S-PLUS 4.5 to Word 97, and 3) also
held true there

I suspect that the anti-aliasing built into the NT4 display engine is
losing narrow lines completely (it does a poor job of small fonts), and if
you do what you did, you will get a much larger nominal page and hence
relatively narrower lines than copying a graphics device to the clipboard.

I might try setting width and height on the win.metafile device to
something much closer to the size you want to include at. (I haven't
do so, though.)

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