<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">That method didn'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 class="">Cheers</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 17 May 2017, at 12:55, Karin Meier-Fleischer <<a href="mailto:meier-fleischer@dkrz.de" class="">meier-fleischer@dkrz.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
Hi Cunbo and Guido,<br class="">
<br class="">
the simple way to do that is:<br class="">
<br class="">
<font color="#3333ff" class=""><tt class=""> xvalues = (/ -10, -5, 0,
5, 10/)</tt><tt class=""><br class="">
</tt><tt class=""> xlabels = (/"-10km", "-5km", "0km", "5km", "10km"/)</tt><tt class=""><br class="">
</tt><tt class=""> </tt><tt class=""><br class="">
</tt><tt class=""> res@tmXBMode = "Explicit" ;-- set x-axis
labeling to explicit</tt><tt class=""><br class="">
</tt><tt class=""> res@tmXBValues = xvalues ;-- values for
x-axis tickmarks</tt><tt class=""><br class="">
</tt><tt class=""> res@tmXBLabels = xlabels ;-- set labels equal
to values (type string)</tt></font><br class="">
<br class="">
Bye,<br class="">
Karin<br class="">
<br class="">
<div class="moz-cite-prefix">Am 17.05.17 um 09:45 schrieb Guido
Cioni:<br class="">
</div>
<blockquote cite="mid:1DC6DA31-F1AD-449D-BA2A-B404B1753902@gmail.com" type="cite" class="">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252" class="">
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->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->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 class="">
<blockquote type="cite" class="">
<div class="">On 17 May 2017, at 09:28, Cunbo HAN <<a moz-do-not-send="true" href="mailto:hancbo@gmail.com" class="">hancbo@gmail.com</a>> 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" class=""><icon_shfx_50m_2d.png></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="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="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 class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<br class="">
<pre wrap="" class="">_______________________________________________
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>
</div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<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 href="http://guidocioni.altervista" class="">http://guidocioni.altervista</a>.org</div>
</div>
<br class=""></div></body></html>