[gradsusr] Help multi-panel plots on a page
Jennifer Adams
jma at cola.iges.org
Wed Aug 28 11:12:01 EDT 2013
On Aug 28, 2013, at 2:00 AM, Zilore Mumba wrote:
> As my earlier post had no heading, I am reposting the same in the hope that it may be seen and I can get help.
> I hope someone can find time to explain to me a few things on panel plots.
> In the panles_demo.gs (snippet below),I do not understand the following:
>
> 1. for four plots on a page I loop through p=1 to p=4, why do we display t
> (I want to display what I have in my file;
The display of variable 't' in the panels_demo script is only for demonstration purposes. Of course, you can plot any variable or expression you want to.
> 2. what is the global variable defined by _vpg.p in this script?
That is a script variable that contains the 'set vpage' command for panel number p.
> 3. How do I put a title corresponding to the graphic validity time, on each
> plot?
One way to do this is to invoke 'q time' and parse the output to get a string that specifies the time that corresponds to your plot and then use 'set string' and 'draw string' to draw it above your plot. Below is a code snippet that I use for this purpose:
function mydate
'query time'
sres = subwrd(result,3)
wday = subwrd(result,6)
i = 1
while (substr(sres,i,1)!='Z')
i = i + 1
endwhile
hour = substr(sres,1,i)
isav = i
i = i + 1
while (substr(sres,i,1)>='0' & substr(sres,i,1)<='9')
i = i + 1
endwhile
day = substr(sres,isav+1,i-isav-1)
month = substr(sres,i,3)
year = substr(sres,i+3,4)
return (hour' 'wday' 'day' 'month' 'year)
--Jennifer
> Help will be appreciated.
> Zilore Mumba
>
> rc = gsfallow("on")
> if (args='')
> say 'Two arguments are required: the # of rows and # of columns'
> return
> else
> nrows = subwrd(args,1)
> ncols = subwrd(args,2)
> endif
>
> 'use wrfout_d01_2013-07-27_00.ctl'
> 'reset'
> panels(args)
> p = 1
> ptot = nrows * ncols
> 'set mproj scaled'
>
> * Loop through each panel and draw a plot
> while (p <= ptot)
> _vpg.p
> 'set t 'p
> 'set grads off'
> 'd t'
> p = p + 1
> endwhile
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer M. Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
111 Research Hall, Mail Stop 2B3
George Mason University
4400 University Drive
Fairfax, VA 22030
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130828/cb500b1a/attachment-0003.html
More information about the gradsusr
mailing list