Programming Gri
1: Introduction
2: Simple example
3: Fancy example
4: Running Gri
5: Programming Gri
6: General Issues
7: X-Y Plots
8: Contour Plots
9: Image Plots
10: Examples
11: Handling Data
12: Gri Commands
13: Gri Extras
14: Evolution of Gri
15: Installing Gri
16: Gri Bugs
17: System Tools
18: Acknowledgments
19: License
20: Newsgroup
21: Concept Index
|
5.7: Mathematics
Gri lets you do some simple mathematical manipulations on your
column and grid data.
The column operators are `= ', `+= ', `-= ', `*= ',
`/= ', `^= ' (exponentiation) and `_= ' (logarithm). There
must be spaces before and after the operators, but no space between the
2 letters of the operators. The operations may be applied not only to
`x ' and `y ' as shown, but also so `z ' (used to hold data
to be contoured or written as symbols), and `u ' and `v ' (used
to store vector fields).
The axis scales are not changed by mathematical operations on the
columns, regardless of whether the scales were set manually or by Gri
command) see Autoscaling.
Elements of columns are available by the `@ ' reverse polish
operator (see rpn Mathematics.).
Examples:
-
To multiply all the x data by 10, use `
x *= 10 '; to add 5 to each
y-value, use `y += 5 '.
-
To set all the y data to 10, do `
y = 10 '. (This will only work if
you've already read column data.)
5.7.1: Grid data
Various commands let you alter grid data as used in contouring
(see Contour Plots.). Possible commands are as follows.
grid data = number
grid data += number
grid data -= number
grid data *= number
grid data /= number
grid data ^= number # take data to power 'number'
grid data _= number # take log base 'number'
|
grid x = number
grid x += number
... others as in `grid data'
|
grid y = number
grid y += number
... others as in `grid data'
|
5.7.1.1: Image data
Various commands let you alter image data (see Images..).
Possible commands are as follows.
image += number
image -= number
image *= number
image /= number
image ^= number # power
image _= number # logarithm
|
5.7.1.2: Image grayscale/colorscale
Various commands let you alter image data (see Images..).
Possible commands are as follows.
image grayscale += number
image grayscale -= number
image grayscale *= number
image grayscale /= number
image grayscale ^= number # power
image grayscale _= number # logarithm
image colorscale += number
image colorscale -= number
image colorscale *= number
image colorscale /= number
image colorscale ^= number # power
image colorscale _= number # logarithm
|
5.7.1.3: Variables
Possible commands are:
.variable. = number
.variable. += number
.variable. -= number
.variable. *= number
.variable. /= number
.variable. ^= number # power
.variable. _= number # logarithm
|
|