retrieving vpage info

Charles Seman Charles.Seman at NOAA.GOV
Tue Dec 1 14:51:14 EST 2009


Muthuvel,

I'm not sure what you might be doing, but here's some code based on a 
technique to shade missing (undef) values a specific color
from a post to the GrADS Listserv by Arindam Chakraborty on  Thu, 23 Jan 
2003: Arindam Chakraborty <arch at CAOS.IISC.ERNET.IN>
---
var_clevs=  ' -32  -16  -8  -4  -2  -1   1   2   4   8  16  32'
var_ccols = '9   14    4   11  5  13   0  10  7   12  8   2   6' ;* note 
"0" for var_clevs between -1 to 1; see 
http://grads.iges.org/grads/gadoc/colorcontrol.html
...
'set vpage 0.0 8.5 0.0 3.5'
'set parea 1.0 7.0 0.4 3.0'
display_var('var',var_clevs,var_ccols)
...
function display_var(var,var_clevs,var_ccols)
*
*  technique to shade missing (undef) values a specific color
*  from a post to the GrADS Listserv by Arindam Chakraborty on
*  Thu, 23 Jan 2003: Arindam Chakraborty <arch at CAOS.IISC.ERNET.IN>
*
 'set grads off'
 'set gxout shaded'
 'd 'var
 'q gxinfo'
  xlin = sublin(result,3)
  ylin = sublin(result,4)
  xl = subwrd(xlin,4)
  xh = subwrd(xlin,6)
  yl = subwrd(ylin,4)
  yh = subwrd(ylin,6)
 'set rgb 16 220 220 220'
 'set line 16'
 'draw recf 'xl' 'yl' 'xh' 'yh
 'set clevs 'var_clevs
 'set ccols 'var_ccols
 'd 'var
 'cbar 0.7'

return
---

Hope this helps,
Chuck

Muthuvel Chelliah wrote:
> The "q gxinfo" tells if it is a landscape or portrait by giving the "page
> size" as 11 by 8.5 OR 8.5 by 11. But If I subdivide the total page plot area
> into multiple regions (say for example to display multiple x-y plots in a
> page) is there any command to give me back the "vpage" dimensions (I mean:
> xmin xmax ymin ymax) that are being used. In other words, once a 'set vpage
> is declared (computed from within another script and set there - this script
> is called from the main script) how do I get that vpage info in the main
> script. I hope this is not confusing. Thanks much for your  time.
> Muthu
>   

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not necessarily
reflect any position of the Government or NOAA."



More information about the gradsusr mailing list