[6328] in s-news-athena

home help back first fref pref prev next nref lref last post

Re: Interactive preparation of presentation graphics from S

daemon@ATHENA.MIT.EDU (Brett Presnell)
Tue Jan 31 11:54:58 1995

To: s-news@utstat.toronto.edu
Cc: charles@playfair.stanford.edu, bates@stat.wisc.edu
Reply-To: presnell@Stat.UFL.Edu
In-Reply-To: Your message of "Mon, 30 Jan 95 14:55:55 -0600"
Date: Tue, 31 Jan 1995 11:25:25 -0500
From: Brett Presnell <presnell@Stat.UFL.Edu>


Doug Bates writes:

> A few years ago I suggested that it may be possible to add the power
> of interactive graphical editing to S graphics cheaply by writing an S
> device driver for a program like "idraw".  Because I am not too
> familiar with the format in which idraw graphics are saved, I cannot
> say how difficult this would be.  I hope it would not be unreasonably
> difficult. Generally it has been easier to create graphics device
> drivers for S than for other scientific graphics systems.  For
> example, S had PostScript output capabilities years (decades?) before
> other statistical or scientific graphics systems.
> 
> With enough study of the format in which graphical objects for idraw
> are stored, it may be straightforward to use S to plot the points,
> lines, axes, etc. then import the stored graphical object into idraw
> where the whiz-bang text, legends, copyright statements, etc. can be
> added added and positioned interactively.

Actually, there is already such an animal available from statlib: the
fig graphics driver for S (maintained by Peter Dalgaard?).  With this
driver you can create plots in the the fig graphics language, import
them into xfig, edit them in just the way you describe, and then
create encapsulated PostScript output with a menu button for inclusion
in your LaTeX documents or whatever.  Xfig actually calls a back end
called transfig to translate the graphic to postscript, and you can
also output the versions of the graphic in the LaTeX picture
environment language, using epic macros, and several other formats.
You can even include TeX/LaTeX math expression in the plot, although I
find the mechanism for doing this a bit cumbersome.

The downside is that I don't know if there's anything like xfig
available for MS Windows or other non-X-windows platforms, although I
don't know of any reason why such a thing couldn't be written.  Also,
the S-fig driver could use a little work.  For example, I've had
trouble in the past getting it to use the PostScript fonts I wanted,
forcing me to change them interactively within xfig.  Still on the
whole it works reasonably well, and a lot of folks around here have
used it since I got everything installed (S-fig driver, xfig,
transfig) about two years ago.

One warning if you install the fig driver.  On our system (Sun SPARCs
running Solaris 2.4 and Splus 3.2) the command suggested in the README
for making fig.o,

	Splus MAKE fig.o CPP_FLAGS=-DSPLUS

does not work, but I found that

	Splus COMPILE fig.o CFLAGS=-DSPLUS

works fine.

As I said, the fig driver in on statlib.  There's just been a new
release of xfig (version 3.1.3) and transfig (v. 3.1.1).  Both are
available ftp.x.org in /contrib/applications/drawing_tools.  Be sure
to set binary mode when transferring.

Part of the announcement:

Xfig is a menu-driven tool that allows the user to draw and manipulate
objects interactively in an X window.  The resulting pictures can be
saved, printed on postscript printers or converted to a variety of
other formats (e.g. to allow inclusion in LaTeX documents).

There is also a newer version of TransFig (3.1.1).  TransFig contains
the post- processor needed by xfig to convert fig files to one of
several output formats, such as PostScript, pic, LaTeX etc.

home help back first fref pref prev next nref lref last post