Re: annotation using gsn_text

From: Adam Phillips (asphilli AT cgd.ucar.edu)
Date: Wed Aug 04 2004 - 11:09:16 MDT


John,

There is a tx resource called txJust that you should be able to use to get done
what you wish to accomplish. The default of txJust is "CenterCenter".
(http://ngwww.ucar.edu/ngdoc/ng/ref/hlu/obj/TextItem.res.html)
(http://ngwww.ucar.edu/ngdoc/ng/qsg/textitem/tx06.gif)

Thus, a simple short script:

(lat_lat = lat coord)

text_res@txJust = "BottomRight"
gsn_text(wks,map,lat_lat+" ",lon,lat,text_res) ;write lat coord, space(s)
                                                ;may be needed
text_res@txJust = "BottomLeft"
gsn_text(wks,map," "+lat_lon,lon,lat,text_res) ;write lon coord, space(s)
                                                ;may be needed

Let us know how it turns out.
Adam

>
>Where lat_lon is equal to lon. I really want to create a new lat_lon that
>has both the lat and lon for each point.
>
>I am using PyNCL so until now I have been doing all of my array manipulation
>in Python but I cannot seem to get an array of strings into the program. I
>would like to make the new array in the NCL script that I could then use to
>label the lat lon points.
>
>OR
>
>Right now gsn_text outputs the text (lat_lon) with the center of the string
>at the lat/lon if interest is there a way to plot the lat to the right of
>the lat/lon point and the lon to the left of the point? I could then just
>have two gsn_text lines and be done.
>
>Thanks,
>
>John Ertl
>
> traj_res = True
> traj_res@tiMainString = "Trajectory"
> traj_res@gsnDraw = False
> traj_res@gsnFrame = False
> traj_res@vpWidthF = .80
> traj_res@vpHeightF = .80
>
> traj_res@mpProjection = "CylindricalEquidistant"
> traj_res@mpLimitMode = "Corners"
>
> traj_res@mpLeftCornerLatF = 0.0
> traj_res@mpLeftCornerLonF = 274.0
> traj_res@mpRightCornerLatF = 65.0
> traj_res@mpRightCornerLonF = 390.0
> traj_res@mpCenterLonF = 0
>
> pres = True
> pres@gsLineThicknessF = 2.0
>
> map = gsn_csm_map_ce(wks,traj_res)
> draw (map)
> gsn_polyline(wks,map,lon,lat,pres)
>
>; add markers to the trajectories
>
> mres = True
> mres@gsMarkerIndex = 16 ; marker style (circle)
> mres@gsMarkerSizeF = 6.0 ; marker size
> mres@gsMarkerColor = "red" ; maker color
> gsn_polymarker(wks,map,lon,lat,mres)
>
> text_res = True
> text_res@txFont = 21 ; Change the default font.
> text_res@txFontHeightF = 0.02 ; Set the font height.
> ; with lat_lon set equal to lon I get the longitude for each point plotted.
>I want both lat and lon plotted at each point
> gsn_text(wks,map,lat_lon,lon,lat,text_res)
>
> frame(wks)
>
>_______________________________________________
>ncl-talk mailing list
>ncl-talk@ucar.edu
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------------------------------------------------------
Adam Phillips email: asphilli@ucar.edu
Climate and Global Dynamics Division tel: (303) 497-1726
National Center for Atmospheric Research fax: (303) 497-1333
P.O. Box 3000
Boulder, CO 80307-3000 http://www.cgd.ucar.edu/~asphilli

_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Wed Aug 04 2004 - 11:06:22 MDT