[ncl-talk] how to print the string of plus-minus sign on the figure with NCL
WUJIE
393069045 at qq.com
Sun Nov 10 06:16:24 MST 2019
Hi NCL experts,
Typically I use "gsn_text_ndc" to show some statistic metrics on the XY Plots, which is easy to do. However, for uncertainty purpose, one may need show " plus-minus sign” between two numbers. Does anyone can help how can I show the "plus-minus sign" with NCL?
I have tried this to make a "plus-minus sign", which is learned from here: http://www.ncl.ucar.edu/Document/Functions/Built-in/NhlNewMarker.shtml
;-----------------------------------------
mstring_tem = "1"
fontnum_tem = 34
xoffset_tem = 0.0
yoffset_tem = 0.0
ratio_tem = 1.0
size_tem = 1.0
angle_tem = 0.0
plus_minus_sign = NhlNewMarker(wks, mstring_tem, fontnum_tem, xoffset_tem, yoffset_tem, ratio_tem, size_tem, angle_tem)
;-----------------------------------------
I then learned that "plus_minus_sign" created by above lines is a number instead of a string, so below line cannot work :
gsn_text_ndc(wks,"Slope = " + sprintf("%3.2f", rc)+plus_minus_sign+sprintf("%3.2f",std)
How can I transfer it to a string?
Thanks,
Jie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191110/0f05b790/attachment.html>
More information about the ncl-talk
mailing list