page

advertisement
6/96
page.doc
w. ebisuzaki
This script can be used to make multiple plots on one page.
documentation is the actual script.
Following this
usage:
run
run
run
run
page
page
page
page
top
bottom
left
right
plot
plot
plot
plot
on
on
on
on
top half of screen
bottom half of screen
left half of screen
right half of screen
run
run
run
run
page
page
page
page
q1
q2
q3
q4
plot
plot
plot
plot
on
on
on
on
quadrant
quadrant
quadrant
quadrant
run page xy XY
1
2
3
4
(x,y,X,Y) are single digits
xy = location, XY = size
only 1 blank between xy and XY
quadrants:
----------| q1 | q2 |
----------| q3 | q4 |
----------Matrix notation:
xy is the location of the page
XY is number of subdivisions
The idea here is that the page is divided into a grid of X by Y
rectangles. Plotting is done in the x-y rectangle. In the
following example, the page is divided into two columns (X=2)
and 3 rows (Y=2).
----------| 13 | 23 |
----------| 12 | 22 |
----------| 11 | 21 |
-----------
xy values for XY=23
To draw into the top left rectangle, you "run page 13 23".
To get the bottom right rectangle, you "run page 21 23".
The following
"run page
"run page
"run page
"run page
commands are equivalent:
q1"
"run page 12 22"
q2"
"run page 22 22"
top"
"run page 12 12"
bottom"
"run page 11 12"
Limitations: X and Y must have values from 1 to 9.
page.gs
function name(arg)
*
* run page position
* position = top bottom left or right
*
q1 q2
*
q3 q4
*
(q=quadrent)
* set virtual page
*
*
* v1.1.1
'set vpage off'
'query gxinfo'
rec2 = sublin(result,2)
xlo = 0
xhi = subwrd(rec2,4)
ylo = 0
yhi = subwrd(rec2,6)
xmid = 0.5 * (xlo + xhi)
ymid = 0.5 * (ylo + yhi)
if ( arg = 'left' )
'set vpage ' xlo ' ' xmid ' ' ylo ' ' yhi
endif
if ( arg = 'right' )
'set vpage ' xmid ' ' xhi ' ' ylo ' ' yhi
endif
if ( arg = 'top' )
'set vpage ' xlo ' ' xhi ' ' ymid ' ' yhi
endif
if ( arg = 'bottom' )
'set vpage ' xlo ' ' xhi ' ' ylo ' ' ymid
endif
if ( arg = 'q1' )
'set vpage ' xlo ' ' xmid ' ' ymid ' ' yhi
endif
if ( arg = 'q2' )
'set vpage ' xmid ' ' xhi ' ' ymid ' ' yhi
endif
if ( arg = 'q3' )
'set vpage ' xlo ' ' xmid ' ' ylo ' ' ymid
endif
if ( arg = 'q4' )
'set vpage ' xmid ' ' xhi ' ' ylo ' ' ymid
endif
if ( arg = '' )
'set vpage ' xlo ' ' xhi ' ' ylo ' ' yhi
endif
ix=substr(arg,1,1)
iy=substr(arg,2,1)
nx=substr(arg,4,1)
ny=substr(arg,5,1)
if (nx >= 1 & nx <= 9 & ny >= 1 & ny <= 9)
x0 = xlo + (xhi - xlo) * (ix - 1) / nx
x1 = xlo + (xhi - xlo) * (ix
) / nx
y0 = ylo + (yhi - ylo) * (iy - 1) / ny
y1 = ylo + (yhi - ylo) * (iy
) / ny
'set vpage ' x0 ' ' x1 ' ' y0 ' ' y1
say 'set vpage ' x0 ' ' x1 ' ' y0 ' ' y1
endif
'set grads off'
Download