Printing specific numerical values in the graphics window
Charles Seman
Charles.Seman at NOAA.GOV
Tue Sep 5 16:29:12 EDT 2006
Jim,
Here is some code that I hope will be of some use (the idea is to plot
the 50m temperature in the lower-left part of the frame, half-way
between the bottom of the plot area and the bottom of the virtual
page)... The code below has not been tested (parts have been adapted
from scripts in which similar techniques have been used...):
pvar_vpage = '0 11 0 8.5'
pvar_parea = '1 10 1.5 6.5'
*
* (xt,yt) is the point at which the character string containing the 50m
temperature will be plotted (see below)...
*
xl = subwrd(pvar_parea,1)
yb_parea = subwrd(pvar_parea,3) ; yb_virtual = subwrd(pvar_vpage,3)
xt = xl ; yt = (yb_parea-yb_virtual)/2 * note, yb_virtual = 0 here...
...
xx = 1 ; yy = 1 ; tt = 1 * specify point for temperature
'set x 'xx
'set y 'yy
'set z 1'
'set t 'tt
'd temp' ; rec = sublin(result,1); temp_value = subwrd(rec,4)
...
'set string 1 l 4' * string is "left-justified"
http://grads.iges.org/grads/gadoc/gradcomdsetstring.html
'set strsiz 0.1'
temp_format = math_format('%6.2f',temp_value) *
http://grads.iges.org/grads/gadoc/mathfunctions.html
'draw string 'xt' 'yt' 50m Temperature at (x,y,t) = ('xx','yy','tt') =
'temp_format
Feel free to ask questions about above code...
I hope this helps,
Chuck
Jim Benedict wrote:
> I'm not sure if this issue has been resolved recently (see emails
> below)...
>
> I'd like to print specific numerical values (e.g., the temperature at
> the lowest level) to the graphics window (and so be seen in the .ps
> file), but I haven't had any luck trying various approaches. The
> important parts of my .ctl file look like this...
> xdef 1 linear 1 1
> ydef 1 linear 1 1
> zdef 199 levels 50 100 150 200 ... [levs are in meters]
> tdef 1 linear 1 1
> vars 2
> temp 199 99 [K]
> qv 199 99 [g/kg]
>
> Basically, I want to print the numerical value of, say, temperature
> at 50 m *in the graphics output file* and not the terminal screen.
> Any help would be appreciated!
> Thanks,
> Jim Benedict
>
>
>
>
> On Aug 21, 2006, at 6:06 AM, Mateus Teixeira wrote:
>
>> Christian Grob a écrit :
>>> Dear Grads-Users,
>>> I'm desperately trying to draw the 1-D values of variables with
>>> Grads. The variables are saved as "var1". the prompt 'd var1' just
>>> shows me the value in the terminal, but not in the seperate Grads
>>> window. I already tried 'd string 1 1 "var1"' and variations of
>>> this prompt, but it always drew "var1" but not the value of this
>>> variable. how can I plot the value into the graphics or maps
>>> created by grads?
>>>
>>> Thanks in advance
>>> Christian
>>> --
>>>
>>>
>>> "Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
>>> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
>>>
>>>
>> Christian,
>>
>> Try this:
>>
>> set t <initial_time> <final_time>
>> d var1
>>
>> It will display a 1D plot in the graphic window.
>>
>>
>> --
>> Mateus da Silva Teixeira
>> Doutorando em Meteorologia - CPTEC/INPE
>> e-mail: mtex2k3 at yahoo.com.br, mateus at cptec.inpe.br
>> site: www.geocities.com/mtex2k3
>>
>>
>>
>> _______________________________________________________
>> Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu
>> celular. Registre seu aparelho agora!
>> http://br.mobile.yahoo.com/mailalertas/
--
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 reflect
any position of the Government or NOAA."
More information about the gradsusr
mailing list