[gradsusr] Multi-panel plots

zeng jian libiecho at 163.com
Tue Sep 18 07:33:38 EDT 2012


hello,
it seems you can't type "  rc = gsfallow("on") " directly  in the command line, but instead you can write it in a script file (.gs). here is an example for using panels() function to draw multi-panel plot, hope it can help you.
 
* draw multi-panel plot, the example is 4 panels
*Modified By Jian Zeng from beijing meteorological bureau
*ensure panels.gsf exists  or download it from ftp://grads.iges.org/grads/scripts/panels.gsf
*
'reinit'
rc = gsfallow("on")
nrows=2
ncols=2
args=nrows%' '%ncols
'sdfopen E:\some\place\somedata.dat'
'set mproj scaled'
panels(args)
*p is the panel number, p=1 means the first panel
p = 1
*ptot indicate the total numbers of panels (or virtual pages)
ptot = nrows * ncols
*here is the loop, draw panel one by one
while (p <= ptot)
*_vpg.p seting the virtual page, NO.p
    _vpg.p
    'set parea 1 9.8 1 7.5'
   'set t 'p
   'set grads off'
   'set gxout shaded'
   'set font 2'
   'set  xlopts 1 4 0.2';'set  ylopts 1 4 0.2' 
   'd skt'
   'set font 0'
   'cbar_interp 1 1 1'
   'zb 30 30 0.1'
    'set font 5';'set strsiz 0.3 0.3'
   'draw string 3.5 8 skt(t='p',panel='p')'
   p = p + 1
endwhile
  'set vpage off'
'printim e:\some\place\somepic.png png white x800 y600'
;

Jian Zeng






At 2012-09-18 18:41:51,"TYTECA Sophie" <sophie.tyteca at meteo.fr> wrote:
>Hello,
>
>I want to use GrADS script function "panels.gsf" to draw multi-panel plot
>all scripts are here: /opt/GrADS/lib and  GASCRP=/opt/GrADS/lib
>I see in panels_demo.gs that I have to use "gsfallow" first, right?
>See below my try :
>
>Grid Analysis and Display System (GrADS) Version 2.0.1
>Copyright (c) 1988-2011 by Brian Doty and the
>Institute for Global Environment and Society (IGES)
>GrADS comes with ABSOLUTELY NO WARRANTY
>See file COPYRIGHT for more information
>
>Config: v2.0.1 little-endian readline printim grib2 netcdf hdf4-sds hdf5 
>opendap-grids,stn geotiff shapefile
>Issue 'q config' command for more detailed configuration information
>GX Package Initialization: Size = 8.5 11
>ga-> open PLGEO500.ctl
>Scanning description file:  PLGEO500.ctl
>Data file PLGEO500.SG3.1959.dat is open as file 1
>LON set to 0 360
>LAT set to -87.864 87.864
>LEV set to 500 500
>Time values set: 1959:1:1:0 1959:1:1:0
>E set to 1 1
>ga-> rc = gsfallow("on")
>Syntax Error:  Invalid Operand
>   'gsfallow' not a variable or function name
>   Error ocurred at column 1
>DEFINE error:  Invalid expression.
>
>thank you for your help
>_______________________________________________
>gradsusr mailing list
>gradsusr at gradsusr.org
>http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120918/7e4251b4/attachment-0003.html 


More information about the gradsusr mailing list