'reinit'
outfile='./outfile_6'
*----------------input--------------------------
infile1='./infile.ctl'
'open 'infile1''
*===============(左上1)==================
'set parea 0.9 4.4 7.3 10.8 '
'set grads off'
'set grid off'
'set lon 30 140'
'set lat 0 60'
'set t 1'
'set z 1'
'set xlopts 1 4 0.16'
'set ylopts 1 4 0.16'
'set xlint 30'
'set ylint 20'
'set xlab off'
'set ylab on'
'd
*================(左2)=========
'set vpage off'
'set parea 0.9 4.4 3.8 7.3'
'set grads off'
'set grid off'
'set lon 30 140'
'set lat 0 60'
'set t 1'
'set z 1'
'set xlopts 1 4 0.16'
'set ylopts 1 4 0.16'
'set xlint 30'
'set ylint 20'
'set xlab off'
'set ylab on'
'd
*================(左3)=========
'set vpage off'
'set parea 0.9 4.4 0.3 3.8'
'set grads off'
'set grid off'
'set lon 30 140'
'set lat 0 60'
'set t 1'
'set z 1'
'set xlopts 1 4 0.16'
'set ylopts 1 4 0.16'
'set xlint 30'
'set ylint 20'
'set xlab on'
'set ylab on'
*=============(右上1)=============
*----------------input--------------------------
'set vpage off'
'set parea 4.5 8 7.3 10.8 '
'set grads off'
'set grid off'
'set lon 30 140'
'set lat 0 60'
'set t 1'
'set z 1'
'set xlopts 1 4 0.16'
'set ylopts 1 4 0.16'
'set xlint 30'
'set ylint 20'
'set xlab off'
'set ylab off'
'd '
*=============(右2)================
'set vpage off'
'set parea 4.5 8 3.8 7.3 '
'set grads off'
'set grid off'
'set lon 30 140'
'set lat 0 60'
'set t 1'
'set z 1'
'set xlopts 1 4 0.16'
'set ylopts 1 4 0.16'
'set xlint 30'
'set ylint 20'
'set xlab off'
'set ylab off'
'd
*=============(右3)================
'set vpage off'
'set parea 4.5 8 0.3 3.8 '
'set grads off'
'set grid off'
'set lon 30 140'
'set lat 0 60'
'set t 1'
'set z 1'
'set xlopts 1 4 0.16'
'set ylopts 1 4 0.16'
'set xlint 30'
'set ylint 20'
'set xlab on'
'set ylab off'
'd
*-----------------------------tu-----------------------------------------
'enable print 'outfile'.gmf'
'print'
'disable print'
'printim 'outfile'.png white x1000 y800'
c
;
*6/96 page.doc w. ebisuzaki
*This script can be used to make multiple plots on one page.
*usage:
* run page top plot on top half of screen
* run page bottom plot on bottom half of screen
* run page left plot on left half of screen
* run page right plot on right half of screen
* run page q1 plot on quadrent 1
* run page q2 plot on quadrent 2
* run page q3 plot on quadrent 3
* run page q4 plot on quadrent 4
* run page xy XY (x,y,X,Y) are single digits
* xy = location, XY = size
* only 1 blank between xy and XY
*quadrents:
* -----------
* | 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 | xy values for XY=23
* -----------
* | 11 | 21 |
* -----------
*
* 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 commands are equivalennt:
* "run page q1" "run page 12 22"
* "run page q2" "run page 22 22"
* "run page top" "run page 12 12"
* "run page bottom" "run page 11 12"
*
*
* Limitations: X and Y must have values from 1 to 9.
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)
xmid = 0.1 * (xlo + xhi)
ymid = 0.1 * (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
* 'set parea 0.5 8 1 10'
* 'set parea ' x0 ' ' x1 ' ' y0 ' ' y1
* say 'set parea ' x0 ' ' x1 ' ' y0 ' ' y1
* xx0 = x0
* xx1 = x1
* yy0 = y0
* yy1 = y1
endif
'set grads off'
竖放6张图片的grads文件
最新推荐文章于 2019-07-30 00:39:03 发布