<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Dear Viviane,<br>
<br>
Please see <a class="moz-txt-link-freetext" href="http://grads.iges.org/grads/gadoc/gradcomdsetxaxis.html">http://grads.iges.org/grads/gadoc/gradcomdsetxaxis.html</a><br>
which contains:<br>
------------------------------------------------------------------------------------------------<br>
<h2><b>set xaxis</b></h2>
<p>
<code>set xaxis <i>start end <increment></i></code>
</p>
<p>Specifies where the labeled tick marks will be placed on the
X-axis. Labeled tick marks begin at the specified
<code><i>start</i></code> value and end at the specified
<code><i>end</i></code> value with the specified
<code><i>increment</i></code>. Labeled tick marks may have no relation
to data or dimensions. </p>
<p></p>
<p></p>
<h3>Usage Notes</h3>
<ol>
<li>Reset by <a
href="http://grads.iges.org/grads/gadoc/gradcomdclear.html">clear</a>,
but not <a
href="http://grads.iges.org/grads/gadoc/gradcomddisplay.html">display</a>.
</li>
<li>See also <a
href="http://grads.iges.org/grads/gadoc/gradcomdsetyaxis.html">set
yaxis</a>.
</li>
</ol>
------------------------------------------------------------------------------------------------<br>
also please see <a class="moz-txt-link-freetext" href="http://grads.iges.org/grads/gadoc/gradcomdsetxlabs.html">http://grads.iges.org/grads/gadoc/gradcomdsetxlabs.html</a><br>
which contains:<br>
<h2>set xlabs</h2>
<code>set xlabs <i>lab1 | lab2 | ...</i></code>
<p>label the <code>x axis</code> with <code><i>lab1, lab2,
lab3,...</i></code></p>
<p></p>
------------------------------------------------------------------------------------------------<br>
<br>
You could also try an interactive approach... Here is some code which
prompts the user for labels and the location to plot them. The "y"
location from the first "bpos" click is used for subsequent "x"
locations so all of the labels are on a straight horizontal line...<br>
<br>
------------------------------------------------------------------------------------------------<br>
<br>
say ' '<br>
say '---------------------------------------------------------'<br>
say ' '<br>
say 'Plotting Numerical Bin Labels'<br>
say ' '<br>
say '---------------------------------------------------------'<br>
say ' '<br>
say 'Enter number of bin labels desired'<br>
pull nbin<br>
if (nbin<=0)<br>
say 'Number of bin labels desired is 'nbin<br>
say 'Is this correct? Yes or No'<br>
pull answer<br>
if(answer=No | answer=no | answer=N | answer=n)<br>
say 'Enter number of bin labels desired'<br>
pull nbin<br>
endif<br>
endif<br>
if (nbin>10)<br>
say 'Number of bin labels desired is 'nbin<br>
say 'Is this correct? Yes or No'<br>
pull answer<br>
if(answer=No | answer=no | answer=N | answer=n)<br>
say 'Enter number of bin labels desired'<br>
pull nbin<br>
endif<br>
endif<br>
if (nbin>0)<br>
say 'Enter bin label #1:'<br>
pull args<br>
say 'Click where you want the label'<br>
'query bpos'<br>
x = subwrd(result,3)<br>
y = subwrd(result,4)<br>
'draw string 'x' 'y' 'args<br>
nb=2<br>
while (nb<=nbin)<br>
say 'Enter bin label #'nb':'<br>
pull args<br>
say 'Click where you want the label'<br>
'query bpos'<br>
x = subwrd(result,3)<br>
'draw string 'x' 'y' 'args<br>
nb=nb+1<br>
endwhile<br>
endif<br>
------------------------------------------------------------------------------------------------<br>
<br>
Another approach would be to use coordinate transformations. The
following is from<br>
<a class="moz-txt-link-freetext" href="http://grads.iges.org/grads/gadoc/script.html#storing">http://grads.iges.org/grads/gadoc/script.html#storing</a><br>
<p><b><code><a
href="http://grads.iges.org/grads/gadoc/gradcomdquery.html">q</a> <i>transform
coord1 coord2</i></code></b> -- Coordinate transformations </p>
<ul>
<p>where <code><i>transform</i></code> is one of: <br>
<code>xy2w </code>XY coords to world coords <br>
<code>xy2gr </code>XY coords to grid coords <br>
<code>w2xy </code>world coords to XY coords <br>
<code>w2gr </code>world coords to grid coords <br>
<code>gr2w </code>grid coords to world coords <br>
<code>gr2xy </code>grid coords to XY coords <br>
</p>
</ul>
<p><i>XY coords</i> are inches on the page (screen) where the page is
11x8.5 inches or 8.5x11 inches, depending on how GrADS was started.
</p>
<p><i>World coords</i> are lat, lon, lev, time or val, depending on
what
the dimension environment is when the grid was displayed. Note that
time is displayed (and must be specified) in GrADS absolute date/time
format. val is the value coordinate for a 1-D plot (linegraph).
</p>
<p><i>Grid coordinates</i> are the i,j indices the grid being
displayed. For station data sets, grid and world coordinates are
equivalent except for the time dimension. Note that if you display a
grid from a 'wrapped' data set, the grid numbers may be out of range
of the actual file grid numbers. (A 'wrapped' data set is a data set
that covers the earth in the longitude direction. Wrapping takes place
automatically). The conversions are done consistently, but you may
want to be sure you can handle the wrapping case if your data set is
global.
</p>
<p>N.B. Coordinate transform queries are only valid after something has
been displayed, and the transformations apply only to the most recent
item that has been displayed.<code><b><br>
</b></code><code></code>------------------------------------------------------------------------------------------------<br>
</p>
I think you could use "w2xy" or "gr2xy" to get the (x,y) plot location
for a label, given a dataset parameter as described above, then draw a
string at that (x,y) location... I don't have any code that does this...<br>
<br>
<br>
<b><code></code></b>I hope this helps,<br>
Chuck<br>
<br>
<br>
<br>
<br>
<br>
Viviane Silva wrote:
<blockquote cite="mid20050209135729.9250.qmail@web51104.mail.yahoo.com"
type="cite">
<pre wrap="">Hi,
I created a histogram in which the interval are -0.5
to 0.5, 0.5 to 1.5, etc. What should I do to make
grads display the x label on the right position? i,e.
have the label,for example, zero below the bar which
correspond to the interval -0.5 to 0.5.
I appreciate your help.
Thanks,
Viviane Silva
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
<a class="moz-txt-link-freetext" href="http://info.mail.yahoo.com/mail_250">http://info.mail.yahoo.com/mail_250</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
********************************************************************
Charles Seman <a class="moz-txt-link-abbreviated" href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a>
Geophysical Fluid Dynamics Laboratory / NOAA
Princeton University voice: (609) 452-6547
P.O. Box 308 fax: (609) 987-5063
Princeton, NJ 08542-0308 <a class="moz-txt-link-freetext" href="http://www.gfdl.noaa.gov/~cjs/">http://www.gfdl.noaa.gov/~cjs/</a>
********************************************************************
"The contents of this message are mine personally and do not reflect
any position of the Government or NOAA."
</pre>
</body>
</html>