<div dir="ltr"><div><div>Hi,<br><br></div>I'm guessing you need to add these resources:<br><br> res@gsnFrame = False ; don't advance frame yet
<br> res@gsnDraw = False ;<br><br></div>and then after your call to gsn_add_text(), issue these commands:<br><div><br> draw(plot)
<br> frame(wks) <br><br></div><div>The docs on gsn_add_text() state that the text is not drawn until the associated plot is drawn, but with these resources, that plot gets drawn immediately in the call to gsn_csm_contour_map_ce()<br><br></div><div>Hope that helps...<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 11, 2014 at 1:51 PM, David Adams <span dir="ltr"><<a href="mailto:dave.k.adams@gmail.com" target="_blank">dave.k.adams@gmail.com</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"><div><div><div><div>Hi NCLers,<br></div>I need to add simple text to GOES image, but the text doesn´t appear.<br></div>It might be due to the funky 2d lat,lon coordinates of GOES images. Any suggestions?<br><br></div>thanks,<br></div><div>Dave<br><br></div><div>---------Code--------------------------------------------<br> diri = "./"<br> file_name = asciiread("file_name",-1,"string")<br> fili ="<a href="http://goes13_4_2013_196_2315_subset.nc" target="_blank">goes13_4_2013_196_2315_subset.nc</a>"<br> f = addfile(diri+fili,"r")<br> new_temp = f->new_temp ; float data(time, yc, xc) ;<br> ; data:type = "IR" ;<br>;*********************************<br>; Fix the variable so it has recognizable missing data<br>;*********************************<br> lat = f->new_lat<br> lon = f->new_lon<br> lat@_FillValue = max(lat)<br> lon@_FillValue = lat@_FillValue<br> new_temp@_FillValue = 255.<br> ; associate coordinates with variable<br> new_temp@lat2d = lat ; (yc, xc)<br> new_temp@lon2d = lon<br><br><br>;*********************************<br>; create plot<br>;*********************************<br> sfx = get_file_suffix(fili,0) ; use file name<br><br>; write output file name using first time record of file list<br> out_file = str_get_cols(file_name(0),0,21)<br> output_file = out_file<br> pltName = output_file<br><br> pltType = "ps" ; "ps", "eps", "pdf", "png"<br> pltDir = "./"<br> wks = gsn_open_wks(pltType, pltDir+pltName)<br> ;gsn_define_colormap(wks,"amwg") ; choose a color map<br> gsn_define_colormap(wks,"BlAqGrYeOrReVi200"); choose a color map<br> res = True<br> res@cnFillOn = True ; turn on color<br> res@cnFillMode = "RasterFill" ; cell mode<br> res@cnLinesOn = False ; Turn off contour lines<br> res@gsnSpreadColors = True ; use full colormap<br> res@gsnAddCyclic = False ; data not cyclic<br> res@gsnMaximize = True ; ps, pdf, pdf<br> res@pmTickMarkDisplayMode = "Always" ; use NCL default<br> ;res@lbOrientation = "Vertical" ; vertical label bar<br> res@lbLabelAutoStride = True ; let NCL decide spacing<br><br> res@mpMinLatF = 22.50 ; min(d@lat2d) ; region to zoom in on<br> res@mpMaxLatF = 33.80 ; max(d@lat2d)<br> res@mpMinLonF = -115.00 ; min(d@lon2d)<br> res@mpMaxLonF = -102.500 ; max(d@lon2d)<br> res@mpFillOn = False<br> ;res@mpOutlineBoundarySets = "USStates" ; turn on state boundaries<br> ;res@mpOutlineBoundarySets = "AllBoundaries"<br> res@mpOutlineBoundarySets = "National" ; turn on country boundaries<br> res@trGridType = "TriangularMesh" ; Necessary b/c lat, lon<br><br> res@cnLevelSelectionMode = "ManualLevels" ;"ExplicitLevels"<br> res@cnMinLevelValF = 200. ; set the minimum contour level<br> res@cnMaxLevelValF = 300. ; set the maximum contour level<br> res@cnLevelSpacingF = 5.0 ; set the contour interval<br> res@cnRasterSmoothingOn = True<br> res@lbLabelStride = 5.0 ; every other label bar label<br><br> res@gsnLeftString = new_temp@type<br> res@tiMainString = fili<br> plot = gsn_csm_contour_map_ce(wks,new_temp(:,:), res)<br><br> txid = new(1,graphic) ; one text string<br><br> txres = True<br> txres@txFont = "helvetica-bold"<br> txres@txFontHeightF = 0.10<br> txid = gsn_add_text (wks,plot,"BASC",-108.2,28.2 ,txres)<br><br></div><div><div><br><br><br><br><div><div><br><br></div></div></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>