function main(args) ** draw_label ** written by Lucas Harris, May 2011 ** Lucas.Harris@noaa.gov string=args ** These parameters can be changed by the user to alter how the label looks 'set string 1 tl' 'set line 0 1 6' 'set strsiz 0.25' 'q gxinfo' line5 = sublin(result,5) line6 = sublin(result,6) xaxis = subwrd(line5,3) yaxis = subwrd(line5,6) proj = subwrd(line6,3) if (xaxis = 'None' | yaxis = 'None') say 'You must display a variable before using draw_label' return endif * Get the image edges for clipping and to determine where to put the string 'q gxinfo' line3 = sublin(result,3) line4 = sublin(result,4) xd1 = subwrd(line3,4) xd2 = subwrd(line3,6) yd1 = subwrd(line4,4) yd2 = subwrd(line4,6) 'set clip 'xd1' 'xd2' 'yd1' 'yd2 xs = 0.99*xd1 + 0.01*xd2 ys = 0.95*yd2 + 0.05*yd1 'q string 'string line1 = sublin(result,1) strwidth = subwrd(line1,4) 'draw recf 'xs' 'ys-strsiz*1.5' 'xs+strwidth' 'ys+strsiz*0.35 'draw string 'xs' 'ys' 'string