The following notes are based on information received from P. A. Seeger, C. T. Dum, and Joe Walston. Please send any suggestions for improvement to Tim Pearson.
Supported system: Microsoft Windows 95 or Windows NT with Microsoft PowerStation Fortran 4.0. Note: applications developed in this Fortran will not execute under DOS or Windows 3.x (no, not even with WIN32s).
Once PGPLOT.LIB is built, applications are most easily compiled using the Microsoft Developer Studio. The application type must be "QuickWin", or it must be compiled with command line option "/MW". Programs execute in a text window, with the graphical output in up to 8 separate child windows. Cursor functions (including rubber-band modes) are implemented with the mouse.
ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz.Uncompress the file (gunzip) and extract the files from the tar archive (tar cv). Versions of gunzip and tar for Windows are available on the Web. One program that will handle both steps is WinZip. It is available from http://www.winzip.com and many other web sites.
The files in the tar archive are organized in a hierarchical directory
structure, with the top level directory called PGPLOT. You
will need the files from the following directories:
x:\PGPLOT
\CPG
\DRIVERS
\EXAMPLES
\FONTS
\PGMF
\SRC
\SYS_WIN
The other SYS_* directories can be ignored.
The directory PGPLOT\SYS_WIN contains system-specific files
for this operating system and compiler:
GRDOS.F
GREXEC.F
GRGFIL.F
GRSY00.F
W9DRIV.F (screen driver)
PGBIND.MAK
Delete the file PGPLOT\SRC\GRGFIL.F; use the
file GRGFIL.F from this directory instead.
The file GREXEC.F is a device dispatch routine that calls
selected PGPLOT device drivers. The distributed version includes
device drivers for Windows screen, PostScript files, and the null
graphics device. If you want to include additional PGPLOT device
drivers, you will need to edit this file before compilation. For more
information, see Appendix E.
Create the binary font file GRFONT.DAT in this directory. This is done by compiling and running program PGPACK. The source code for this is file PGPACK.F in subdirectory \FONTS (it is a self-contained program). Program PGPACK requires file GRFONT.TXT (also in \FONTS) as its standard input stream; you may need to edit PGPACK.F to open this file explicitly if you cannot redirect the standard input. If PGPACK runs successfully, it will report
Characters defined: 996 Array cells used: 26732
PGPLOT programs need to read files RGB.TXT and GRFONT.DAT at run time. If you put them in a different directory, specify that directory name in the environment variable PGPLOT_DIR; or specify the full [path]filenames dor the two files in environment variables PGPLOT_RGB and PGPLOT_FONT.)
x:\PGPLOT\SRC\GR*.F
x:\PGPLOT\SRC\PG*.F
x:\PGPLOT\SYS_WIN\*.F
x:\PGPLOT\DRIVERS\LXDRIV.F,NUDRIV.F,PSDRIV.F
(The dependent *.INC files will be included automatically.)Alternatively, you can compile all the files with the command-line compiler, rather than using the Developer Studio.
SET PGPLOT_VIDEO=VGA (or V), 640 * 480
SVGA (or S), 800 * 600
XGA (or X), 1024 * 768
ZGA (or Z), 1280 * 1024
Modes may also be selected by using alternate device types
"/WV", "/WS", "/WX", or "/WZ". Modes exceeding the capability of the
Windows screen driver will be reduced to the maximum available. For
an example of the 236-color modes, see PGDEMO4. For an example of
different resolutions, try using "/WV" for the first window and
"/WX" for the second window in PGDEMO13.
CALL PGSCR(0, 1., 1., 1.) ! background color becomes white
CALL PGSCR(1, 0., 0., 0.) ! foreground color becomes black
before making the version to be printed; another is to cut and paste
to a utility (I use Paint-Shop-Pro) in which you can adjust the color
palette; and a third way is to specify the "/PS" device and write a
file. (Note: this might be a good use for a custom menu entry in
your application.) Yet another option is to create a second device
window and change the color palette only in that window. (See
PGDEMO13 for an example of multiple simultaneous windows.)
To build the cpgplot binding library, you will need the following files:
PGPLOT\CPG\PGBIND.C PGPLOT\SYS_WIN\PGBIND.MAK PGPLOT\CPG\PGBIND_PROTOTYPESThese files can be located anywhere convenient.
To build the library, from a console (DOS) window type
NMAKE /F PGBIND.MAKThis will create cpgplot.lib and cpgplot.h.
The makefile compiles pgbind.c (no unusual compiler flags are needed) to produce the pgbind program. It then produces the C wrapper functions (one file per wrapper) and the cpgplot.h header file using:
pgbind ms -w -h pgbind_prototypesThe cpg*.c files are then compiled and gathered into a library.
To use cpgplot in your programs, you should include cpgplot.h at the top of all C files that use cpgplot functions, and link your programs with both of cpgplot.lib and pgplot.lib.
For further information about using the C binding, see file
PGPLOT\CPG\CPGPLOT.DOCor the Web page
http://www.astro.caltech.edu/~tjp/pgplot/cbinding.html