- 积分
- 36
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-8-24
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我的设置是 set lat 28 38
set lon 108 120
图1是利用XYLAB所画,图2是未使用XYLAB所画 ,对比发现图1的X和Y轴标注不全,缺坐标的头尾坐标—108 120 28 38
为何不能像图2那样显示坐标,应如何修改程序,请高手们不吝赐教。本人为初学,XYLAB的程序也已经琢磨一番,但仍百思不得其解,还请指导一二,先谢谢了。 另外如何去掉坐标右边和上面的刻度线呀?
以下是所使用的XYLAB.GS文件
- *************************************************************
- * Author: wave *
- * *
- * last modified : Apr 10, 2003 *
- *************************************************************
- * This GrADS script is used to redraw the axis labels
- *============================================================
- *
- function xylab(args)
- ****************** USAGE *************************************
- ff=subwrd(args,1)
- usage0="suggest to use 'set xlab off' ; 'set ylab off' in your main GS"
- usage1="usage: xylab lons lone londel lats late latdel strsiz font thick ticbg ticsm"
- usage2="lons start of longitude"
- usage3="lone end of longitude"
- usage4="londel interval of small longitude tics"
- usage5="lats start of latitude"
- usage6="late end of latitude"
- usage7="strsiz size of tic label"
- usage8="font font number of tic label"
- usage9="thick thickness of axises and tics"
- usage10="ticbg size of big tics"
- usage11="ticsm size of small tics"
- usage12="If any keyword misses a value, the function dose not work"
- if (ff='')
- say usage1
- say usage2
- say usage3
- say usage4
- say usage5
- say usage6
- say usage7
- say usage8
- say usage9
- say usage10
- say usage11
- say usage12
- return
- endif
- xsta=subwrd(args,1)
- xend=subwrd(args,2)
- xdel=subwrd(args,3)
- ysta=subwrd(args,4)
- yend=subwrd(args,5)
- ydel=subwrd(args,6)
- strsiz=subwrd(args,7)
- fnt=subwrd(args,8)
- thick=subwrd(args,9)
- tic1=subwrd(args,10)
- tic2=subwrd(args,11)
- if(strsiz != '');'set strsiz 'strsiz' 'strsiz*0.9'';endif
- if(tic1 = '' | tic2 = '');tic1=0.035;tic2=0.06;endif
- if(fnt = '');fnt=0;endif
- xpts=(xend-xsta)/xdel
- ypts=(yend-ysta)/ydel
- 'q dims'
- ll=sublin(result,2)
- xv=subwrd(ll,3)
- ll=sublin(result,3)
- yv=subwrd(ll,3)
- ll=sublin(result,4)
- zv=subwrd(ll,3)
- if(xv = fixed);l1=3;l2=4;endif
- if(yv = fixed);l1=2;l2=4;endif
- if(zv = fixed);l1=2;l2=3;endif
- xx=sublin(result,l1)
- yy=sublin(result,l2)
- lon1=subwrd(xx,6);lon2=subwrd(xx,8)
- lat1=subwrd(yy,6);lat2=subwrd(yy,8)
- 'q gxinfo'
- recx=sublin(result,3)
- recy=sublin(result,4)
- xdl=subwrd(recx,4)
- xur=subwrd(recx,6)
- ydl=subwrd(recy,4)
- yur=subwrd(recy,6)
- if(thick != 0 & thick != '')
- 'set line 0 1 6'
- 'draw rec 'xdl' 'ydl' 'xur' 'yur''
- xdl=xdl+0.005;xur=xur-0.007;ydl=ydl+0.007;yur=yur-0.005
- 'set line 1 1 'thick''
- 'draw rec 'xdl' 'ydl' 'xur' 'yur''
- endif
- x1=xdl;y1=ydl;x2=xur;y2=yur
- 'set line 1 1 3'
- 'set string 1 tc 4'
- i=0
- while(i<xpts+1)
- 'q w2xy 'xsta+i*xdel' 'lat1''
- xdl=subwrd(result,3);ydl=y1
- if(xdl > x1 & xdl < x2)
- 'draw line 'xdl' 'ydl' 'xdl' 'ydl-tic2''
- if(xv = varying)
- if(xsta+i*xdel < 180)
- 'draw string 'xdl' 'ydl-tic2-0.015' `'fnt''xsta+i*xdel'`3.`'fnt'E'
- endif
- if(xsta+i*xdel > 180)
- 'draw string 'xdl' 'ydl-tic2-0.015' `'fnt''360-xsta-i*xdel'`3.`'fnt'W'
- endif
- if(xsta+i*xdel = 180)
- 'draw string 'xdl' 'ydl-tic2-0.015' `'fnt''xsta+i*xdel'`3.'
- endif
- else
- if(xsta+i*xdel < 0)
- 'draw string 'xdl' 'ydl-tic2-0.015' `'fnt''0-xsta-i*xdel'`3.`'fnt'S'
- endif
- if(xsta+i*xdel > 0)
- 'draw string 'xdl' 'ydl-tic2-0.015' `'fnt''xsta+i*xdel'`3.`'fnt'N'
- endif
- if(xsta+i*xdel =0)
- 'draw string 'xdl' 'ydl-tic2-0.015' `'fnt'EQ'
- endif
- endif
- endif
- i=i+2
- endwhile
- i=1
- while(i<xpts+1)
- 'q w2xy 'xsta+i*xdel' 'lat1''
- xdl=subwrd(result,3);ydl=y1
- if(xdl > x1 & xdl < x2)
- 'draw line 'xdl' 'ydl' 'xdl' 'ydl-tic1''
- endif
- i=i+2
- endwhile
- i=0
- while(i<xpts+1)
- 'q w2xy 'xsta+i*xdel' 'lat2''
- xdl=subwrd(result,3);ydl=y2
- if(xdl > x1 & xdl < x2)
- 'draw line 'xdl' 'ydl' 'xdl' 'ydl+tic2''
- endif
- i=i+2
- endwhile
- i=1
- while(i<xpts+1)
- 'q w2xy 'xsta+i*xdel' 'lat2''
- xdl=subwrd(result,3);ydl=y2
- if(xdl > x1 & xdl < x2)
- 'draw line 'xdl' 'ydl' 'xdl' 'ydl+tic1''
- endif
- i=i+2
- endwhile
- 'set string 1 r 4'
- i=0
- while(i<ypts+1)
- 'q w2xy 'lon1' 'ysta+i*ydel''
- xdl=x1;ydl=subwrd(result,6)
- if(ydl > y1 & ydl < y2)
- 'draw line 'xdl' 'ydl' 'xdl-tic2' 'ydl''
- if(zv = varying)
- 'draw string 'xdl-tic2-0.015' 'ydl' `'fnt''ysta+i*ydel''
- else
- if(ysta+i*ydel < 0)
- 'draw string 'xdl-tic2-0.015' 'ydl' `'fnt''0-ysta-i*ydel'`3.`'fnt'S'
- endif
- if(ysta+i*ydel > 0)
- 'draw string 'xdl-tic2-0.015' 'ydl' `'fnt''ysta+i*ydel'`3.`'fnt'N'
- endif
- if(ysta+i*ydel =0)
- 'draw string 'xdl-tic2-0.015' 'ydl' `'fnt'EQ'
- endif
- endif
- endif
- i=i+2
- endwhile
- i=1
- while(i<ypts+1)
- 'q w2xy 'lon1' 'ysta+i*ydel''
- xdl=x1;ydl=subwrd(result,6)
- if(ydl > y1 & ydl < y2)
- 'draw line 'xdl' 'ydl' 'xdl-tic1' 'ydl''
- endif
- i=i+2
- endwhile
- i=0
- while(i<ypts+1)
- 'q w2xy 'lon2' 'ysta+i*ydel''
- xdl=x2;ydl=subwrd(result,6)
- if(ydl > y1 & ydl < y2)
- 'draw line 'xdl' 'ydl' 'xdl+tic2' 'ydl''
- endif
- i=i+2
- endwhile
- i=1
- while(i<ypts+1)
- 'q w2xy 'lon2' 'ysta+i*ydel''
- xdl=x2;ydl=subwrd(result,6)
- if(ydl > y1 & ydl < y2)
- 'draw line 'xdl' 'ydl' 'xdl+tic1' 'ydl''
- endif
- i=i+2
- endwhile
- 'set string 1 c 4'
- return
|
-
-
|