Graphics: Viewing & Printing


Windows and Graphics

OK, I don't have much to say here yet. If you have Splus on Windows, graphics can be copied and pasted quite easily. Splus4 for Windows even allows you to cut and paste components easily.

However, if you are running Splus over the Internet (e.g. WiscWorld at home) and want to write documents at home in Word, you have other options. One is to create a postscript file of a graphic in S (see S-Plus Graphics & LaTeX below) and use ghostview or Adobe Acrobat or some other postscript reader available on Windows. Another approach is to use xv (see unix below) while on our Unix system. This viewer can convert postscript to JPEG or GIF or other standard graphics forms, which can then be ported (via FTP) to your machine.


Unix Commands for Graphics & Printing

Check manual entries (man dvipr) for more information on most unix commands. See also the Unix Guide.
dvipr
prints file.dvi on laser printer
dvips
converts file.dvi to postcript file.ps
ghostview
View postscript documents. Can use dvips to convert latex (or tex) compiled document file.dvi into postscript file.ps. This embeds any postscript plots. Ghostview has interactive options for rotation, magnifying and printing marked pages.
gnuplot
This freeware package is limited but handy. The USENET newsgroup is comp.graphics.gnuplot. Online documents include: Gnuplot Manual, General Utilities and Info, Gnuplot FAQs.
gs
see ghostview above
latex, tex
see dvipr, dvips, xdvi
see S-Plus Graphics & LaTeX
pdf2ps
translate Portable Document Format (PDF or Adobe Acrobat) to PostScript
R
many plot commands--see HTML Help pages
sas
SAS/Insight and SAS/Graph apparently have nice figures, but few in this department have any experience. Many users have stated that SAS/Graph is difficult to learn and use. Some biostatisticians allegedly use and enjoy SAS/Insight. Others use a blend of basic SAS and S. Anyone want to contribute to our knowledge here?
xlispstat
xdvi
can view file.dvi on X terminal
xv
X-window viewer can view GIF, JPEG and even PS files. Can be used to convert between formats. Right mouse button opens menu window.

S/R Graphics & LaTeX

For more on this subject, see Statistical Reporting with S/R (Frank Harrell, Vanderbilt Medical Center).

Latex takes a file of commands mydoc.tex and produces a device-independent file mydoc.dvi. The device-independent viewer xdvi can incorporate postscript images into DVI file display. Thus you can view postscript files that are included into latex using psfig. See the xdvi command for details.

   % latex mydoc
   % xdvi mydoc

Alternatively, you can explicitly create postcript file mydoc.ps from your dvi file and and view it with the postscript display command ghostview.

   % latex mydoc
   % dvips mydoc
   % ghostview mydoc.ps
The .ps is required for the ghostview command.

I have an example using S to put a figure in a LaTeX document. Here are buttons to the source:

Note: LaTeX/2e handles postcript somewhat differently from earlier versions. If you use \documentstyle, you can put the call for psfig there:
\documentstyle[psfig]{article}
\begin{document}
...
\end{document}
Alternatively, you can invoke \usepackage such as
\documentstyle{article}
\usepackage{epsfig}
\begin{document}
...
\end{document}
See the Goossens book for more information.
Return to U WI Statistics Home Page

Last modified: Fri Jan 29 15:52:07 1999 by Brian Yandell Tue May 2 15:16:31 1995 by Stat Www (statwww@stat.wisc.edu)