<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Guido,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Could you email me the exact error message? I&#39;m curious if there&#39;s something we can improve on our end. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Karin&#39;s suggested method should work, as long as the tmXBValues that you give it correspond with the actual values on your X axis.  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There are some cases where the plotting function tries to label the axes for you in a certain way (like if call gsn_csm_contour and you have longitude values on the X axis), but most of them should allow you to overwrite this with tmXBValues/tmXBLabels without complaining.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 17, 2017 at 5:33 AM, Guido Cioni <span dir="ltr">&lt;<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">That method didn&#39;t work for me sometimes as it was complaining because the variable that I was plotting had lat/lon attributes attached. But it should work most of the times.<div>Cheers</div><div><div class="h5"><div><br><div><blockquote type="cite"><div>On 17 May 2017, at 12:55, Karin Meier-Fleischer &lt;<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>&gt; wrote:</div><br class="m_9101266645884621539Apple-interchange-newline"><div>
  
    
  
  <div 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 = (/&quot;-10km&quot;, &quot;-5km&quot;, &quot;0km&quot;, &quot;5km&quot;, &quot;10km&quot;/)</tt><tt><br>
      </tt><tt> </tt><tt><br>
      </tt><tt>  res@tmXBMode   = &quot;Explicit&quot;        ;-- 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="m_9101266645884621539moz-cite-prefix">Am 17.05.17 um 09:45 schrieb Guido
      Cioni:<br>
    </div>
    <blockquote type="cite">
      
      Hey Cunbo,
      <div>that&#39;s a problem that I faced many times and I
        haven&#39;t found a clean solution, yet. All the methods that I&#39;ve
        used to manually define the labels have failed somehow. The
        &quot;easy&quot; solution that I&#39;m using now is to define a new variable
        for your axis and then use that for plotting.</div>
      <div><br>
      </div>
      <div>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&#39;ve done was:</div>
      <div><br>
      </div>
      <div><font face="Menlo" size="1">; 1 - defining
          the half-lenght of the two axis (in your case 10 km)</font></div>
      <div>
        <div><font face="Menlo" size="1">half_lenght_x=10.</font></div>
      </div>
      <div>
        <div><font face="Menlo" size="1">half_lenght_y=10.</font></div>
      </div>
      <div><font face="Menlo" size="1"><br>
        </font></div>
      <div><font face="Menlo" size="1">; 2 - manually
          compute the two axis as km</font></div>
      <div><font face="Menlo" size="1">; using the
          longitude and latitude arrays from</font></div>
      <div><font face="Menlo" size="1">; your input
          File</font></div>
      <div><font face="Menlo" size="1"><br>
        </font></div>
      <div>
        <div><font face="Menlo" size="1"> dist_x:=(half_lenght_x/180.)*<wbr>(File-&gt;lon)</font></div>
        <div><font face="Menlo" size="1"> dist_x@units=
            &quot;km&quot;</font></div>
        <div><font face="Menlo" size="1"> dist_x@long_name
            = &quot;Distance&quot;</font></div>
        <div><font face="Menlo" size="1"> dist_x@standard_name
            = &quot;distance&quot;</font></div>
        <div><font face="Menlo" size="1"><br>
          </font></div>
        <div>
          <div><font face="Menlo" size="1"> dist_y:=(half_lenght_y/90.)*(<wbr>File-&gt;lat)</font></div>
          <div><font face="Menlo" size="1"> dist_y@units=
              &quot;km&quot;</font></div>
          <div><font face="Menlo" size="1"> dist_y@long_name
              = &quot;Distance&quot;</font></div>
          <div><font face="Menlo" size="1"> dist_y@standard_name
              = &quot;distance&quot;</font></div>
        </div>
        <div><font face="Menlo" size="1"><br>
          </font></div>
        <div><font face="Menlo" size="1">; 3 - use
            these two variables, which will have the same dimension as
            the coordinate variables, to plot</font></div>
        <div><font face="Menlo" size="1"> ResC@sfXArray
            := dist_x</font></div>
        <div><font face="Menlo" size="1"> ResC@sfYArray
            := dist_y </font></div>
      </div>
      <div><br>
      </div>
      <div>Note that you will need to remove any reference to
        the old coordinate variables from the variable that you&#39;re
        plotting (so any attribute...).</div>
      <div><br>
      </div>
      <div>Hope that helps</div>
      <div><br>
        <div>
          <blockquote type="cite">
            <div>On 17 May 2017, at 09:28, Cunbo HAN &lt;<a href="mailto:hancbo@gmail.com" target="_blank">hancbo@gmail.com</a>&gt; wrote:</div>
            <br class="m_9101266645884621539Apple-interchange-newline">
            <div>
              <div style="word-wrap:break-word">Dear
                ncl-talk,<br>
                <br>
                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><br>
                </div>
                <div>Best,</div>
                <div>Cunbo
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><span id="m_9101266645884621539cid:86C26A44-DB83-409A-BCBC-743A27E59EA1@wlan.kfa-juelich.de">&lt;icon_shfx_50m_2d.png&gt;</span></div>
                </div>
              </div>
              ______________________________<wbr>_________________<br>
              ncl-talk mailing list<br>
              <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
              List instructions, subscriber options, unsubscribe:<br>
              <a class="m_9101266645884621539moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
            </div>
          </blockquote>
        </div>
        <br>
        <div>
          <div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br class="m_9101266645884621539Apple-interchange-newline">
            Guido Cioni</div>
          <div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://guidocioni.altervista/" target="_blank">http://guidocioni.altervista</a>.<wbr>org</div>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="m_9101266645884621539mimeAttachmentHeader"></fieldset>
      <br>
      <pre>______________________________<wbr>_________________
ncl-talk mailing list
<a class="m_9101266645884621539moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="m_9101266645884621539moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
  </div>

______________________________<wbr>_________________<br>ncl-talk mailing list<br><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br></div></blockquote></div><br><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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br class="m_9101266645884621539Apple-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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://guidocioni.altervista" target="_blank">http://guidocioni.altervista</a>.<wbr>org</div>

</div>
<br></div></div></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>