NEW Gnuplot
4.1 included!
* This document is less
useful when printed.
Installation (back to top)
1) Download file.
2) Double click on
downloaded file. Make sure you extract the files to your GAMS system
directory. The files “gnupltxy.gms”, “rt1.exe”, and
“callgplt.bat” have to be placed in the inclib subdirectory.
Description (back to top)
Gnupltxy.gms allows users to easily plot data
from GAMS runs in GNUPLOT. It is similar to the GNUPLOT interface created
by Thomas Rutherford. However, Gnupltxy.gms
is easily applicable to purely quantitative data. It is flexible in a sense
that each data series to be plotted can contain its own x-axis sequence. For
example, the data listed below can easily be plotted.
|
x1 |
y1 |
x2 |
y2 |
x3 |
y3 |
|
1 |
1 |
0 |
2 |
1 |
6 |
|
2 |
2 |
3 |
2 |
2 |
4 |
|
4 |
3 |
5 |
5 |
3 |
3 |
|
10 |
4 |
7 |
6 |
4 |
1 |
|
12 |
5 |
8 |
7 |
|
|
|
13 |
6 |
|
|
|
|
Gnupltxy.gms is user friendly as only
one single line is needed in order to produce a good plot. However, many of the
default options can be changed by using option commands as documented below. In
addition, one can modify the gnupltxy.gms file for personal needs and
preferences. Guidelines of how to do it will be posted in the future but can
also be obtained from the authors.
The data to be graphed must be contained in a parameter
which has three arguments. The number of elements in the first argument
determines the number of different lines in a plot. The number of elements
in the second argument determines the number of points on a particular
line. The remaining argument must contain at least two set elements of
which one represents the x-axis and a second the y-axis coordinates.
Syntax
(back to top)
Lines in [] are not necessary. They serve to override
default options.
[$setglobal globalvariable value]
[$setglobal globalvariable value]
$libinclude gnupltxy parameter
xaxis yaxis
[$setglobal globalvariable value]
[$libinclude gnupltxy parameter
xaxis yaxis]
Plotting
options
(back to top)
|
|
|
|
Variable |
|
|
Default value |
|
|
|
|
gp_title |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
Variable |
|
|
Default value |
|
|
|
gp_color |
|
|
color | |
|
|
|
|
|
|
|
|
|
|
|
gp_style |
|
|
lines | |
|
|
|
|
gp_line |
|
|
solid |
|
|
|
|
|
|
|
|
|
|
|
gp_lwidth |
|
|
1 | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
Variable |
|
|
Default value |
|
X-axis label |
|
|
gp_xlabel |
|
|
|
|
Y-axis label |
|
|
gp_ylabel |
|
|
|
|
X2-axis label |
|
|
gp_x2label |
|
|
|
|
Y2-axis label |
|
|
gp_y2label |
|
|
|
|
|
|
|
|
|
|
|
|
X2-axis |
|
|
gp_x2scale |
|
|
not set |
|
Y2-axis |
|
|
gp_y2scale |
|
|
not set |
|
|
|
|
|
|
|
|
|
Logarithmic scale |
|
|
gp_logscale |
|
|
none |
|
|
|
|
|
|
|
Can use: "x", "y",
"xy", "none" |
|
Tics location |
|
|
gp_tics |
|
|
in |
|
X-axis major
tics |
|
|
gp_xtics |
|
|
yes |
|
Y-axis major
tics |
|
|
gp_ytics |
|
|
yes |
|
|
|
|
|
|
|
|
|
|
|
gp_xrange |
|
|
no (gnuplot default
is used) | |
|
|
|
gp_yrange |
|
|
no (gnuplot default
is used) | |
|
|
|
|
gp_x2range |
|
|
not set |
|
|
|
|
gp_y2range |
|
|
not set |
|
|
|
|
|
|
|
|
|
|
|
gp_xinc |
|
|
no (gnuplot default
is used) | |
|
|
|
gp_yinc |
|
|
no (gnuplot default
is used) | |
|
Y-axis label
rotation |
|
|
gp_yrotate |
|
|
yes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
Variable |
|
|
Default value |
|
Vertical line at y =
0 |
|
|
gp_xzeroax |
|
|
no |
|
Horizontal line at x
= 0 |
|
|
gp_yzeroax |
|
|
no |
|
Both x = 0 and y = 0
line |
|
|
gp_zeroax |
|
|
no |
|
|
|
|
|
|
|
|
|
Horizontal and
vertical grid |
|
|
gp_grid |
|
|
no |
|
Vertical grid |
|
|
gp_xgrid |
|
|
no |
|
Horizontal grid |
|
|
gp_ygrid |
|
|
no |
|
|
|
gp_gline |
|
|
4 (if monochrome:
13) | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
Variable |
|
|
Default value |
|
Border |
|
|
gp_border |
|
|
yes |
|
|
|
gp_borddim |
|
|
all
(default) | |
|
Boxwith |
|
|
gp_boxwid |
|
|
no (gnuplot
default) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
Size |
|
|
gp_size |
|
|
no (gnuplot
default) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
Variable |
|
|
Default value |
|
|
|
gp_font |
|
|
Times New Roman | |
|
Size |
|
|
gp_fntsize |
|
|
12 |
|
|
|
|
|
|
|
|
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_supzero |
yes |
suppress all (0,0)
data |
|
|
no |
do not suppress all
(0,0) data |
|
|
|
default: no |
|
|
|
|
|
gp_zeroend |
no |
don't use (0,0) data
at the end of a series |
|
|
yes |
use (0,0) data at
the end of a series |
|
|
|
default: no |
|
|
|
|
|
|
|
|
|
|
|
|
Note: Most of the below described plotting options work
gp_term = windows (default)
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_term |
windows |
default, shows graph
in gnuplot program |
|
|
cgm |
computer graphics
metafile |
|
|
postscript |
postscript |
|
|
aifm |
|
|
|
gif |
use only if you have
Unisys license. |
|
|
png |
|
|
|
|
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_color |
color |
|
|
|
monochrome |
|
|
|
|
|
Global
and individual line styles
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_style |
lines |
sets global default
line style |
|
|
linespoints |
|
|
|
points |
|
|
|
dots |
|
|
|
boxes |
|
|
|
steps |
|
|
gp_line |
solid |
only if terminal is
set to postscript |
|
|
dashed |
only if terminal is
set to postscript |
|
gp_l1style |
points |
sets individual
style to first line |
|
|
… |
|
|
gp_l2style |
|
sets individual
style to second line |
|
… |
|
|
|
gp_l15style |
|
sets individual
style to ninth line |
|
|
|
|
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_lwidth |
1 |
Default |
|
|
4 |
lines 4 times
thicker |
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_key |
no |
|
|
|
yes |
default location:
top left |
|
|
bottom left |
|
|
|
top right |
|
|
|
bottom right
outside |
|
|
|
350,100 |
places key at x =
350, y = 100 |
|
|
|
|
|
|
|
|
|
gp_keytitl |
no |
default |
|
|
your key title |
|
|
gp_keyopt |
no |
default |
|
|
Left |
left justification
of labels (default) |
|
|
reverse |
reverse label and
sample display |
|
|
width -12 |
decrease the
distance between label and sample by 12 |
|
|
samplen 4 |
determines length of
sample in legend (4 = default) |
|
|
spacing 1.25 |
vertical spacing
between lines (1.25 = default) |
|
|
Right noreverse
width 6 |
can use
combination |
|
gp_keybox |
no |
default |
|
|
0 |
no box |
|
|
yes |
box around
legend |
|
|
anything |
box around
legend |
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_xrange |
number1
: number2 |
uses x-axis range
from number1 to number2 |
|
gp_yrange |
number1
: number2 |
uses y-axis range
from number1 to number2 |
|
|
no |
gnuplot default |
|
|
0 |
gnuplot default |
|
gp_y2range |
no |
gnuplot default |
|
|
number1
: number2 |
uses 2nd y-axis range from number1 to number2 |
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_xinc |
number |
|
|
gp_yinc |
number |
|
|
|
no |
gnuplot default |
|
|
0 |
gnuplot default |
|
|
|
|
|
|
|
|
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_gline |
no |
|
|
|
4 |
|
|
|
13 |
|
|
|
|
|
|
|
|
more gnuplot
reference |
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_borddim |
1 |
draws x-axis
only |
|
|
x |
draws x-axis
only |
|
|
2 |
draws y-axis
only |
|
|
y |
draws y-axis
only |
|
|
3 |
draws x-axis and
y-axis |
|
|
two |
draws x-axis and
y-axis |
|
|
four |
draws all axis |
|
|
all |
draws all axis |
|
|
|
|
|
|
|
|
Global variables |
Some available
values |
Description,
comments, further reference |
|
gp_font |
Times New Roman |
|
|
|
Arial Bold
Italic |
|
|
|
Helvetica |
|
|
|
|
|
|
|
|
Comments (back to top)
The interface has not been tested extensively. Most
of the testing was done using GAMSIDE and the terminal type "Windows".
Last changes were made in October 2003. If you find bugs, or if you have
questions or comments, please feel free to email Uwe at schneider@dkrz.de.
Credits (back to top)
This software interface was jointly developed by
Uwe Schneider and Bruce
McCarl. Substantial credit goes to Thomas
Rutherford. His existing gnuplot
interface provided extremely useful guidance for establishing this
program. Additional contributions were made by Michael Bussieck and Armin
Pruessner from GAMS Development Corporation.
Thanks go to Bernhard Reiter and Hans-Bernhard Broeker
from the GNUPLOT team.