Follow the normal installation procedure:
$ sudo mv pgplot5.2.tar.gz /usr/local/src
$ cd /usr/local/src
$ sudo tar xzvf pgplot5.2.tar.gz
$ sudo mkdir /usr/local/pgplot
$ cd /usr/local/pgplot
$ sudo cp /usr/local/src/pgplot/drivers.list .
Edit the file drivers.list and uncomment (select) the drivers
/NULL
(null device),
/PS, /VPS, /CPS, /VCPS
(PostScript drivers), and
/XWINDOW, /XSERVE
(X window drivers).
Run makemake
to prepare the makefile for a Linux system with g77_gcc compiler,
$ sudo /usr/local/src/pgplot/makemake /usr/local/src/pgplot linux g77_gcc
Edit the file makefile and replace lines 25 and 26:
FCOMPL=g77
FFLAGC=-u -Wall -fPIC -O
by the following lines:
FCOMPL=gfortran
FFLAGC=-ffixed-form -ffixed-line-length-none -u -Wall -fPIC -O
Continue the normal installation procedure,
$ sudo make
$ sudo make clean
and, assuming that LD_LIBRARY_PATH points to /usr/local/lib,
$ cd /usr/local/lib
$ sudo ln -s /usr/local/pgplot/libpgplot.so .
Define the environment variable PGPLOT_DIR
, pointing to your installation directory. This can be done by adding to your .bashrc
or .bash_profile
file the lines
# PGplot
export PGPLOT_DIR='/usr/local/pgplot'
Additionally, you can customize PGplot by adding the following lines to your .bashrc or .bash_profile:
# Default xwindow device
export PGPLOT_DEV='/xwin'
# Default white background
export PGPLOT_BACKGROUND='white'
# Default black foreground
export PGPLOT_FOREGROUND='black'
# Marking text written in the ps file so it can be be edited
export PGPLOT_PS_VERBOSE_TEXT='yes'
You may want to have an xwindow with 256 colors, and make the server window not visible. This can be done by starting the pgxwin_server
with these options:
# Starting pgxwin_server
/usr/local/pgplot/pgxwin_server -win_maxColors 256 -server_visible False