<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Alan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">This is an issue for me as well, and I was surprised to see there's no ticket for this. I just created one (NCL-2125). </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I don't think this is a bug. It's simply an oversight that we never created a "format" type of resource for labelbar labels.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can work around this somewhat awkwardly by:</div><div class="gmail_default" style="font-size:small"><ul><li>Creating the plot (set res@gsnDraw = False and res@gsnFrame = False)<br></li><li>Retrieving the "cnLineLabelStrings" resource to get the formatted strings</li><li>Setting "res@lbLabelStrings" to this retrieved resource</li><li>Recreating the plot with the newly added lbLabelStrings resource</li></ul><div>You can also set lbLabelStrings the first time you create the plot, but then you would have to use "sprintf" as you mentioned above.</div><div><br></div><div>I've attached a modified version of your script that uses the method outlined above.</div><div><br></div><div>--Mary</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 9:57 AM, Alan Brammer <span dir="ltr"><<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">NCLers. <br><br>I would like to be able to format a color bar label, without using sprintf. It seems that <a href="https://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnLineLabelFormat" target="_blank">cnLineLabelFormat</a> claims that it should do this job but for me today it is not making any difference to the label bar. <br><br>Am I missing a step or something? cnLineLabelFormat does it's job nicely on the plot, but has no impact on the labelbar. <br><br><br>Request:<br>Existence of an lbLabelFormat resource, that is potentially linked to cnLineLabelFormat when not defined itself. <div><br></div><div>For now I will stick to creating my own array of labels, and pumping them through sprintf. <br></div><div><br></div><div><br></div><div>Thanks, </div><div> ~Alan.</div><div><br></div><div><br></div><div><br></div><div>example code of cnLineLabelFormat not affecting the label bar below:</div><div><br><div>x = fspan(-5, 5, 100)</div><div>data = new( (/100,100/), float)</div><div>do y=0, 99</div><div>data(y,:) = exp(( -(x^2)/4) - (((x(y))^2))) ;; quick way of creating some nice data to plot. </div><div>end do</div><div><br></div><div>wks = gsn_open_wks("x11","")</div><div><br></div><div>res = True</div><div>res@cnFillOn = True</div><div>res@cnFillMode= "RasterFill"</div><div>res@cnLinesOn = False</div><div>res@cnLineLabelsOn = True<span></span><span></span><a href="http:///" target="_blank"></a></div><div>res@cnLineLabelFormat = "0@;*.4f"</div><div>res@lbAutoManage = False</div><div>res@lbOrientation = "vertical"</div><div>plot = gsn_csm_contour(wks, data, res)</div></div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>