load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" begin PI = 3.14159 x = new(64,float) x = ispan(1,64,1) ; X points for both XY plots y1 = sin(PI*x/32.) ; Y points for first XY plot y2 = cos(PI*x/32.) ; Y points for first XY plot wks = gsn_open_wks("ncgm","gsn_add_text") gsn_define_colormap(wks,(/"white","black","blue","hotpink",\ "yellow","green"/)) xyres = True xyres@gsnDraw = False xyres@gsnFrame = False xy1 = gsn_xy(wks,x,y1,xyres) ; Create 2 XY plots; don't draw them xy2 = gsn_xy(wks,x,y2,xyres) ; advance the frame. txres = True txres@txFont = "Helvetica-bold" ; change the font ; ; Add text to first plot. ; txres@txFontColor = "blue" ; change the font color anno = gsn_add_text(wks,xy1,"this is a",20.,0.3,txres) ; ; Add text to second plot. ; txres@txFontColor = "green" ; change the font color anno = gsn_add_text(wks,xy2,"text string",10.,0.0,txres) ; ; Panel the plots. ; gsn_panel(wks,(/xy1,xy2/),(/2,1/),False) end