<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Douglas/all,</DIV>
<DIV>Thank you for your support, i manage to solve the problem. This is portion of my cbarn.gs used to plot my clour bar :</DIV>
<DIV>*********************************************************************************************************</DIV>
<DIV>* Script to plot a colorbar<BR>*<BR>* The script will assume a colorbar is wanted even if there is<BR>* not room -- it will plot on the side or the bottom if there is<BR>* room in either place, otherwise it will plot along the bottom and<BR>* overlay labels there if any. This can be dealt with via<BR>* the 'set parea' command. In version 2 the default parea will<BR>* be changed, but we want to guarantee upward compatibility in<BR>* sub-releases.<BR>*<BR>*<BR>* modifications by mike fiorino 940614<BR>* rvp added by diane stokes 20040729<BR>* cinc added by diane stokes 20050130<BR>*<BR>* - the extreme colors are plotted as triangles<BR>* - the colors are boxed in white<BR>* -
input arguments in during a run execution:<BR>*<BR>* <U> run cbarn <STRONG>cinc</STRONG> sf vert xmid ymid rvp<BR></U>*<BR>* cinc - increment for labels<BR>* sf - scale the whole bar 1.0 = original 0.5 half the size, etc.<BR>* vert - 0 FORCES a horizontal bar = 1 a vertical bar<BR>* xmid - the x position on the virtual page the center the bar<BR>* ymid - the x position on the virtual page the center the bar<BR>* rvp - 1 resets virtual page (one colorbar for several plots)<BR>*<BR>* if cinc is not specified, every color interval is labeled<BR>* if vert,xmid,ymid are not specified, they are
selected<BR>* as in the original algorithm<BR>*<BR>* if rvp is not specified, it is 0 (don't reset virtual page)</DIV>
<DIV>*******************************************************************************************************</DIV>
<DIV>if you can see, the cbarn arguments are cinc sf vert xmid ymid rvp, there is additional argument before the sf. in my script below i omit the cinc argument, i solve the problem by assign 1 for cinc argument. </DIV>
<DIV> </DIV>
<DIV>here is my script :</DIV>
<DIV> 'set grads off'<BR> 'set parea 0.5 7.7 0.5 9.5'<BR> 'set mpdset /usr/local/lib/grads/hires'<BR> 'set map 1 1 2'<BR> 'set annot 1'<BR> 'set gxout shaded'<BR> 'set clevs 'colndx<BR> 'set ccols 'colevs<BR>* 'd wht*1.25'<BR> 'd wht'<BR> <U><STRONG> 'run /usr/local/lib/grads/script/cbarn.gs 1.0 1 7.9 4.9'---></STRONG></U>corrected cbarn.gs <STRONG>1 </STRONG>1.0 1 7.9 4.9</DIV>
<DIV><STRONG><U></U></STRONG><BR> 'set gxout vector'<BR> 'set ccolor 1'<BR> 'set arrscl 0.15'<BR> 'define wamv=cos(0.0174532*wdir)'<BR> 'define wamu=sin(0.0174532*wdir)'<BR> skp=4<BR> 'd skip(wamu,'skp','skp');wamv'<BR> 'set gxout contour'<BR> 'set cint 1'<BR> 'set clab forced'<BR> 'set ccolor 0'<BR> 'd mpr'<BR> 'draw string 7.5 0.35 'metres </DIV>
<DIV> </DIV>
<DIV>But i don't know why the i encounter the problem since 2 days ago after using the same script for plotting since 2005.....</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV>Antoy<BR><BR><BR>--- On <B>Thu, 2/5/09, Douglas Clark <I><dbcl@ceh.ac.uk></I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: Douglas Clark <dbcl@ceh.ac.uk><BR>Subject: Re: Color legend in horizontal / vertical position (cbarn)<BR>To: antoyc@yahoo.com<BR>Date: Thursday, February 5, 2009, 5:33 PM<BR><BR><PRE>Sorry - just saw your later post in which you say the optional arguments
didn't work.
I've no idea.
Doug
>>> Douglas Clark 05/02/2009 09:28 >>>
Antoy,
No idea why the bar changes if everything else really is identical as you said.
Could be some hard-to-find quirk.
Can't you solve this using the optional arguments to cbarn?
Form cbarn.gs:
* run cbarn sf vert xmid ymid
*
* sf - scale the whole bar 1.0 = original 0.5 half the size, etc.
* vert - 0 FORCES a horizontal bar = 1 a vertical bar
* xmid - the x position on the virtual page the center the bar
* ymid - the x position on the virtual page the center the bar
So set vert=1 to ensure a vertical bar (and then xmid,ymid if it still moves
about at all).
Doug
>>> Antoy Chang <antoyc@yahoo.com> 05/02/2009 01:04 >>>
Hi everybody,
I have problem when displaying the 2 wave forecast using exactly the same
script but different color bar position (using cbarn) one is placed horizontally
while the other vertically. How to solve this?, i want to place both vertically,
the print area is exactly the same on both display. Why this inconsistency
happen?. Really appreciate your feedback.Thank You.
p/s : Look at the attached files.
--- On Wed, 2/4/09, Madhusoodanan M.S. <madhusoodanan@GMAIL.COM> wrote:
From: Madhusoodanan M.S. <madhusoodanan@GMAIL.COM>
Subject: Re: error in ctl file
To: GRADSUSR@LIST.CINECA.IT
Date: Wednesday, February 4, 2009, 10:11 PM
hi,
your script appears to have some problems.
check the header of taux.cdf (ncdump -h taux.cdf ==> it will give nx and
ny.)
'set x 129.5 320.5' ==> ??? longitude will vary from 0 359.5 (if
global)
that means x will vary from 1 720 and
y from 1 361 (if from 90S to 90N)
.ctl file to read the tauxobs.grd should be correctly made then.
cheers,
Madhu
'reinit'
'sdfopen taux.cdf'
'set gxout fwrite'
'set fwrite tauxobs.grd'
'set x 129.5 320.5'
'set y 121.5 171.5'
'set z 1'
'set t 1 24'
'd taux'
'disable fwrite'
and the data length in tauxobs.grd is 193*52*24*4, where nx=193, ny=52, and
t=24,
so, where is the error in file i am not getting it, that is it display the
variable for only time t=1, not for the other time,
please help me.
with redgards
anushri
--
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.
</PRE></BLOCKQUOTE></td></tr></table><br>