<div dir="ltr"><div class="gmail_default" style="font-size:small">Matt,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You still need to use the tmXBMode / tmXBLabels / tmXBFormat resources, and then you can use the string formatting capability in Python.</div><div class="gmail_default" style="font-size:small"><br></div><font face="monospace, monospace">lats = [-30, -20.41 , -9.21, 2.589, 14.316]<br>lons = [125.0, 143.123, 158.91, 173.689, 188.71]<br><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">tmXBLabels</span> = (["{:0.2f}~C~{:0.2f}".format(lats[i],lons[i]) for i in range(len(lats))])<br>print(<span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">tmXBLabels</span>)</font><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">This should produce:</div><div class="gmail_default" style="font-size:small"><br></div><font face="monospace, monospace">['-30.00~C~125.00', '-20.41~C~143.12', '-9.21~C~158.91', '2.59~C~173.69', '14.32~C~188.71']</font><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">which you can use as your argument to xmXBLabels.</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><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 5, 2018 at 2:46 PM, Fearon, Dr. Matthew, Contractor, Code 7533 via pyngl-talk <span dir="ltr"><<a href="mailto:pyngl-talk@ucar.edu" target="_blank">pyngl-talk@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-899917944246237516WordSection1">
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am trying to produce lat/long labels along the x-axis in an XY plot in a manner consistent with the third/lower panel in the following plot:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><a href="https://www.ncl.ucar.edu/Applications/Images/calipso_2_2_lg.png" target="_blank">https://www.ncl.ucar.edu/<wbr>Applications/Images/calipso_2_<wbr>2_lg.png</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In NCL, I was able to embed a carriage return in a string format sequence as follows:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">tmXBLabels = sprintf("%.1f",xlabel_lat)+"~<wbr>C~"+sprintf("%.1f",xlabel_lon)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m not sure if there is an equivalent in PyNGL or Python for adding labels this way in Ngl.xy? Any suggestions would be greatly appreciated.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you,<u></u><u></u></p>
<p class="MsoNormal">Matt<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
pyngl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/pyngl-talk</a><br>
<br></blockquote></div><br></div>