Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > dcaf9bd555d1ce386641f56c6523d3ed > files > 125

grads-2.0.2-1.fc18.i686.rpm

<!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->

<html>
<head>
<title>GrADS Command: set clab</title>
<style type="text/css">
<!--
.style1 {color: #990000}
-->
</style>
</head>
<body bgcolor="e0f0ff" text="#000000">

<h2><b>set clab</b></h2>

<p>
<code>set clab <i>option</i></code>

<p>
Controls contour labeling. The <code><i>option</i></code>
argument may be one of the following:

<ul>
<code>on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>'fast' contour labels are plotted where the contour lines are horizontal <br>
<code>off&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>no contour labels <br>
<code>forced&nbsp;&nbsp;&nbsp;</code>an attempt is made to label all contour lines <br>
<code><i>format</i>&nbsp;&nbsp;&nbsp;</code>gives a C-language template for conversion of the contour value to a string <br>
<code>masked&nbsp;&nbsp;&nbsp;</code>(<span class="style1">version 2.0.a6+</span>) contour lines have gaps for the labels, so rectangles for label background are not drawn; contour labels never overlap.<br>
</ul>

<p>
<h3>Usage Notes</h3>
<ol>
<li>Changes to the contour labels are reset by <a
href="gradcomdclear.html">clear</a>, but not <a
href="gradcomddisplay.html">display</a>.
<li> When <code>'set clab masked'</code> is used, the contour lines are masked out wherever the labels are drawn. The mask creates small gaps in the contour lines, so the labels can be read clearly without the small rectangles that are usually drawn behind the contour label. The mask also ensures that labels do not overlap. If additional contour plots are overlaid, the new labels do not interfere with labels already drawn. The end result is a less cluttered graphic that is much more legible. 
<li> When <code>'set clab masked'</code> is used,  you can defer  drawing  the map until after all the labeled contours have been drawn, and then the label mask will also create gaps in the map outine for ultimate contour label legibility. 
<li>The <code>'clear mask'</code> command resets the contour label mask.
</ol>

<p>
<h3>Examples </h3>
<ol>
  <li>This command would cause all contour labels to have 2 digits after the decimal point:<br>
    <code>&nbsp;&nbsp;&nbsp;set clab %.2f<br>
    <br>
</code> </li>
  <li>For contouring temperatures, this command would add a degree symbol and the letter "C":<br>
  <code>&nbsp;&nbsp;&nbsp;set clab %.0f`3.`1C </code> <br>
    <br>
  </li>
  <li> Here are two graphics that illustrate the effect of using <code>'set clab masked'</code> in a display containing shaded contours and an overlay of labeled line contours. The default behavior is shown on the left; masked contour labels are shown on the right. The script fragments used to draw the plots are also provided below the images. Observe that contour lines and coastal boundaries are not drawn underneath the masked labels, so the white rectangles are not needed as a background. In addition, the masked labels do not overlap, making all of them legible. <br>
  </li>
</ol>
<table width="700" border="0">
  <tr>
    <td><img src="clab_default.png" alt="default" width="490" height="555"></td>
    <td><img src="clab_masked.png" alt="masked" width="484" height="554"></td>
  </tr>
  <tr>
    <td valign="top"><p><code>cl='480 490 500 510 520 530 540 550 560 570 580 590 600 610'<br>
      cc='&nbsp;&nbsp;&nbsp;9  &nbsp;14&nbsp;&nbsp;   4  &nbsp;11&nbsp;&nbsp;   5  &nbsp;13   &nbsp;&nbsp;3  &nbsp;10   &nbsp;&nbsp;7  &nbsp;12   &nbsp;&nbsp;8   &nbsp;&nbsp;2&nbsp;&nbsp;   6'<br>
      'set rgb 16 70 70 70'<br>
      'set annot 16'<br>
    'set map 0'</code><code><br>
        * draw shaded contours<br>
        'set gxout shaded'<br>
        'set clevs 'cl<br>
        'set ccols 'cc <br>
        'set xlint 40'<br>
        'd z(lev=500)/10'<br>
        * draw labeled contours<br>
        'set gxout contour'<br>
        'set ccolor 16'<br>
        'set clevs 'cl</code><code><br>
        'set clopts 1'<br>
        'd z(lev=500)/10'<br>
        </code></p>
    </td>
    <td><p><code>cl='480 490 500 510 520 530 540 550 560 570 580 590 600 610'<br>
      cc='&nbsp;&nbsp;&nbsp;9  &nbsp;14&nbsp;&nbsp;   4  &nbsp;11&nbsp;&nbsp;   5  &nbsp;13   &nbsp;&nbsp;3  &nbsp;10   &nbsp;&nbsp;7  &nbsp;12   &nbsp;&nbsp;8   &nbsp;&nbsp;2&nbsp;&nbsp;   6'<br>
      'set rgb 16 70 70 70'<br>
      'set annot 16'<br>
      'set map 0'<br>
      * turn off map<br>
      'set mpdraw off'<br>
      * draw shaded contours<br>
      'set gxout shaded'<br>
      'set clevs 'cl<br>
      'set ccols   'cc<br>
      'set xlint 40'<br>
      'd z(lev=500)/10'<br>
      * draw labeled contours<br>
      'set gxout contour'<br>
      'set ccolor 16'<br>
      'set clevs 'cl</code><code><br>
        'set clopts 1'<br>
        'set clab masked'<br>
        'd z(lev=500)/10'<br>
        * draw the map<br>
        'set mpdraw on'<br>
    'draw map'</code></p>
    </td>
  </tr>
</table>
</body>
</html>