<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Cunbo and Guido,<br>
    <br>
    the simple way to do that is:<br>
    <br>
    <font color="#3333ff"><tt>  xvalues = (/ -10,     -5,     0,    
        5,     10/)</tt><tt><br>
      </tt><tt>  xlabels = (/"-10km", "-5km", "0km", "5km", "10km"/)</tt><tt><br>
      </tt><tt> </tt><tt><br>
      </tt><tt>  res@tmXBMode   = "Explicit"        ;-- set x-axis
        labeling to explicit</tt><tt><br>
      </tt><tt>  res@tmXBValues =  xvalues          ;-- values for
        x-axis tickmarks</tt><tt><br>
      </tt><tt>  res@tmXBLabels =  xlabels          ;-- set labels equal
        to values (type string)</tt></font><br>
      <br>
    Bye,<br>
    Karin<br>
    <br>
    <div class="moz-cite-prefix">Am 17.05.17 um 09:45 schrieb Guido
      Cioni:<br>
    </div>
    <blockquote
      cite="mid:1DC6DA31-F1AD-449D-BA2A-B404B1753902@gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      Hey Cunbo,
      <div class="">that's a problem that I faced many times and I
        haven't found a clean solution, yet. All the methods that I've
        used to manually define the labels have failed somehow. The
        "easy" solution that I'm using now is to define a new variable
        for your axis and then use that for plotting.</div>
      <div class=""><br class="">
      </div>
      <div class="">I believe you also have, like me, some coordinate
        informations in the x and y axis although the domain is
        idealized, that is defined only in terms of grid resolution,
        right? So what I've done was:</div>
      <div class=""><br class="">
      </div>
      <div class=""><font class="" face="Menlo" size="1">; 1 - defining
          the half-lenght of the two axis (in your case 10 km)</font></div>
      <div class="">
        <div class=""><font class="" face="Menlo" size="1">half_lenght_x=10.</font></div>
      </div>
      <div class="">
        <div class=""><font class="" face="Menlo" size="1">half_lenght_y=10.</font></div>
      </div>
      <div class=""><font class="" face="Menlo" size="1"><br class="">
        </font></div>
      <div class=""><font class="" face="Menlo" size="1">; 2 - manually
          compute the two axis as km</font></div>
      <div class=""><font class="" face="Menlo" size="1">; using the
          longitude and latitude arrays from</font></div>
      <div class=""><font class="" face="Menlo" size="1">; your input
          File</font></div>
      <div class=""><font class="" face="Menlo" size="1"><br class="">
        </font></div>
      <div class="">
        <div class=""><font class="" face="Menlo" size="1"> dist_x:=(half_lenght_x/180.)*(File-&gt;lon)</font></div>
        <div class=""><font class="" face="Menlo" size="1"> dist_x@units=
            "km"</font></div>
        <div class=""><font class="" face="Menlo" size="1"> dist_x@long_name
            = "Distance"</font></div>
        <div class=""><font class="" face="Menlo" size="1"> dist_x@standard_name
            = "distance"</font></div>
        <div class=""><font class="" face="Menlo" size="1"><br class="">
          </font></div>
        <div class="">
          <div class=""><font class="" face="Menlo" size="1"> dist_y:=(half_lenght_y/90.)*(File-&gt;lat)</font></div>
          <div class=""><font class="" face="Menlo" size="1"> dist_y@units=
              "km"</font></div>
          <div class=""><font class="" face="Menlo" size="1"> dist_y@long_name
              = "Distance"</font></div>
          <div class=""><font class="" face="Menlo" size="1"> dist_y@standard_name
              = "distance"</font></div>
        </div>
        <div class=""><font class="" face="Menlo" size="1"><br class="">
          </font></div>
        <div class=""><font class="" face="Menlo" size="1">; 3 - use
            these two variables, which will have the same dimension as
            the coordinate variables, to plot</font></div>
        <div class=""><font class="" face="Menlo" size="1"> ResC@sfXArray
            := dist_x</font></div>
        <div class=""><font class="" face="Menlo" size="1"> ResC@sfYArray
            := dist_y </font></div>
      </div>
      <div class=""><br class="">
      </div>
      <div class="">Note that you will need to remove any reference to
        the old coordinate variables from the variable that you're
        plotting (so any attribute...).</div>
      <div class=""><br class="">
      </div>
      <div class="">Hope that helps</div>
      <div class=""><br class="">
        <div>
          <blockquote type="cite" class="">
            <div class="">On 17 May 2017, at 09:28, Cunbo HAN &lt;<a
                moz-do-not-send="true" href="mailto:hancbo@gmail.com"
                class="">hancbo@gmail.com</a>&gt; wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <div style="word-wrap: break-word; -webkit-nbsp-mode:
                space; -webkit-line-break: after-white-space;" class="">Dear
                ncl-talk,<br class="">
                <br class="">
                I am doing a contour plot with “gsn_csm_contour_map” and
                I want to setup XY labels manually. Like in the attached
                plot, how can I change the XBLabels “10w, 5w, 0, 5E,
                10E” to “-10km, -5km, 0km, 5km, 10km “? Does anyone know
                how to modify this? Thanks very much!
                <div class=""><br class="">
                </div>
                <div class="">Best,</div>
                <div class="">Cunbo
                  <div class=""><br class="">
                  </div>
                  <div class=""><br class="">
                  </div>
                  <div class=""><span
                      id="cid:86C26A44-DB83-409A-BCBC-743A27E59EA1@wlan.kfa-juelich.de">&lt;icon_shfx_50m_2d.png&gt;</span></div>
                </div>
              </div>
              _______________________________________________<br
                class="">
              ncl-talk mailing list<br class="">
              <a moz-do-not-send="true" href="mailto:ncl-talk@ucar.edu"
                class="">ncl-talk@ucar.edu</a><br class="">
              List instructions, subscriber options, unsubscribe:<br
                class="">
              <a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br
                class="">
            </div>
          </blockquote>
        </div>
        <br class="">
        <div class="">
          <div style="color: rgb(0, 0, 0); font-family: Helvetica;
            font-size: 12px; font-style: normal; font-variant-caps:
            normal; font-weight: normal; letter-spacing: normal;
            orphans: auto; text-align: start; text-indent: 0px;
            text-transform: none; white-space: normal; widows: auto;
            word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br
              class="Apple-interchange-newline">
            Guido Cioni</div>
          <div style="color: rgb(0, 0, 0); font-family: Helvetica;
            font-size: 12px; font-style: normal; font-variant-caps:
            normal; font-weight: normal; letter-spacing: normal;
            orphans: auto; text-align: start; text-indent: 0px;
            text-transform: none; white-space: normal; widows: auto;
            word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a
              moz-do-not-send="true" href="http://guidocioni.altervista"
              class="">http://guidocioni.altervista</a>.org</div>
        </div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
  </body>
</html>