The X Window System is a standard component of GNU/Linux and virtually all current versions of Unix, including Mac OS X. A high-quality implementation of X is freely available for MS-Windows (Cygwin/X, from http://www.cygwin.com/); if you use MS-Windows, it will be well worth the modest effort required to download and install an X server. If you will be using plt with an X server, please skip ahead to section 2.3 below.
If you have not already installed plt, please see appendix F, beginning on page .
plt can generate PostScript plots, which can be printed directly on PostScript printers or (via ghostscript) on a variety of non-PostScript printers. ghostscript can also render PostScript on-screen, but this is most easily managed using a GUI wrapper such as gv, ggv, mgv, ghostview, or GSView. All of these require an X server, except that GSView can use native graphics when running on MS-Windows or OS/2. See http://www.cs.wisc.edu/ ghost/gv/ for details on these GUI wrappers for ghostscript.
When using plt without an X server running, always send the output to lwcat. There are two ways to do this:
You can easily follow along with all of the examples in this book, which work using the PostScript driver in exactly the same way as when using the X driver, if you simply add ``| lwcat -gv'' to the end of each plt command. (You may omit ``-gv'' if you are running within a Cygwin/bash window under MS-Windows.) When you do this, the output of plt is opened in a gv or GSView window. Using gv or GSView's controls, you can save the plot as a file, print it (on any printer supported by GhostScript, not just on PostScript printers), and view it at natural or magnified scales. (Drivers for a vast range of printers are included with GhostScript; see http://www.ghostscript.com/ for a list of supported printers.)
You might reasonably wonder why lwcat is not part of plt. The reason is that the output of several plt commands can be concatenated and supplied to lwcat in a single batch to create multiple plots on a single page (see chapter 7). To do this, group the plt commands together within a pair of parentheses, separating them with newlines or semicolons; then send the output of the entire group to lwcat, either like this:
( plt data1 ... ; plt data2 ...; plt data3 ... ) | lwcat
or like this:
( plt data1 ... ; plt data2 ...; plt data3 ... ) >output.plt lwcat <output.plt
If you are paying particularly close attention while reading the rest of this book, you may notice that plt accepts the option -T lw to specify PostScript output. If an X server is not running, this is the default, so that the -T lw option can be omitted. Furthermore, lwcat accepts the option -gv to specify that the output is to be opened using gv (GSView under MS-Windows), but this is the default if you are running plt and lwcat in a Cygwin/bash window, so that the -gv option can be omitted in this case. If you attempt to run plt and lwcat under MS-Windows in a DOS window (which is not recommended), or in some other way (also not recommended), you will need to use the -gv option explicitly.