Re: Caption to fig

From: <araligin_at_nyahnyahspammersnyahnyah>
Date: Thu, 16 Nov 2006 15:44:50 -0800

Thanks Adam ..that worked fine.

Thanking you,
Nilesh

Quoting Adam Phillips <asphilli_at_cgd.ucar.edu>:

> Hi Nilesh,
>
> Try adding resP_at_gsnFrame = False to your panel resource list.
>
> Think of setting gsnFrame = False being equivalent to telling NCL not to
> flip the page. When you call gsn_panel the panel plots are drawn
> (because by default gsnDraw = True) and the page is flipped after the
> plots are drawn (because by default gsnFrame = True). You need to tell
> NCL not to flip the page after it draws the panel plots. To do that, you
> set gsnFrame = False in your panel resource list.
>
> Hopefully that explanation makes sense.
> Good luck,
> Adam
>
> araligin_at_onid.orst.edu wrote:
> > Hi,
> >
> > I am trying to put Caption at the bottom of the Fig as given in the
> example
> > on NCL website using "gsn_text_ndc " . But I am not getting the caption
> > printed on the output fig. Can'nt make out where am I going wrong.
> > I have attached the ncl code.
> >
> > Thanking you,
> > Nilesh
> >
> >
> > ------------------------------------------------------------------------
> >
> > load "/home/server/student/homes/naraligi/contributed/gsn_code.ncl"
> > load "/home/server/student/homes/naraligi/contributed/gsn_csm.ncl"
> > load "/home/server/student/homes/naraligi/contributed/shea_util.ncl"
> > load "/home/server/student/homes/naraligi/contributed/contributed.ncl"
> >
> >
> >
> > begin
> >
> >
> > fil = asciiread("events_point.txt",(/37,9/),"integer")
> >
> > phase=fil(:,6)
> >
> >
> > rfil ="~/research/composite/towspd.nc"
> > wdfil ="~/research/composite/wspd.nc"
> > wdfil1 ="~/research/qkscat/q_filt.nc"
> > vcfil = addfile(wdfil,"r")
> > tofil = addfile(rfil,"r")
> > isofil = addfile(wdfil1,"r")
> >
> >
> > phase_at_units = "days since 0-1-1 00:00:0.0"
> >
> > ymd = ut_calendar(phase,0)
> >
> > mon=ymd(:,1)
> >
> > i = ind(mon.eq.5.or.mon.eq.6.or.mon.eq.7.or. \
> > mon.eq.8.or.mon.eq.9.or.mon.eq.10)
> >
> > u1=isofil->u(phase(i),:,:)
> > v1=isofil->v(phase(i),:,:)
> > towsp=tofil->wspd(phase(i),:,:)
> > vcwsp=vcfil->wspd(phase(i),:,:)
> > edwsp=towsp-vcwsp
> > edwsp!0="time"
> > edwsp!1="lat"
> > edwsp!2="lon"
> >
> > lat = u1&lat
> > lon = u1&lon
> >
> >
> > mnu1=dim_avg(u1(lat|:,lon|:,time|:))
> > mnv1=dim_avg(v1(lat|:,lon|:,time|:))
> > mntowsp=dim_avg(towsp(lat|:,lon|:,time|:))
> > mnvcwsp=dim_avg(vcwsp(lat|:,lon|:,time|:))
> > mnedwsp=dim_avg(edwsp(lat|:,lon|:,time|:))
> >
> >
> >
> > mnu1!0="lat"
> > mnv1!0="lat"
> > mntowsp!0="lat"
> > mnvcwsp!0="lat"
> > mnedwsp!0="lat"
> >
> > mnu1!1="lon"
> > mnv1!1="lon"
> > mntowsp!1="lon"
> > mnvcwsp!1="lon"
> > mnedwsp!1="lon"
> >
> > print("error is after this")
> > mnu1&lat = lat
> > mnv1&lat = lat
> > mntowsp&lat = lat
> > mnvcwsp&lat = lat
> > mnedwsp&lat = lat
> >
> >
> > mnu1&lon = lon
> > mnv1&lon = lon
> > mntowsp&lon = lon
> > mnvcwsp&lon = lon
> > mnedwsp&lon = lon
> >
> >
>
;=====================================================================================
> > wks = gsn_open_wks("ps","eddyphase7_nsum")
> > gsn_define_colormap(wks,"gui_default")
> > plot = new(3,graphic)
> >
> > res = True
> > res_at_mpProjection = "Mercator"
> > res_at_mpPerimOn = True
> > res_at_mpFillOn = True
> > res_at_mpCenterLonF = 180
> > res_at_mpLandFillColor = "black" ; set land to be gray
> >
> > res_at_gsnFrame = False ; don't advance frame
> > res_at_gsnDraw = False ; don't draw
> > res_at_gsnScalarContour = True
> >
> > res_at_cnFillOn = True
> > res_at_cnLineLabelsOn = False
> > res_at_cnLinesOn = False
> > res_at_lbLabelBarOn = False
> > res_at_lbLabelFontAspectF = 0.5
> >
> > ;res_at_lbOrientation = "Vertical" ; vertical label bar
> > ;res_at_pmLabelBarOrthogonalPosF = 0.18 ; move label bar closer
> >
> > res_at_mpLimitMode = "LatLon"
> > res_at_mpMinLatF = -15
> > res_at_mpMaxLatF =15
> > res_at_mpMinLonF = 130
> > res_at_mpMaxLonF = 205
> >
> > ;res_at_vpXF = 0.12
> > ;res_at_vpYF = 3.0
> > ;res_at_vpWidthF = 0.8
> > ;res_at_vpHeightF = 1.0
> >
> > res_at_pmTickMarkDisplayMode = "Always"
> > ;res_at_pmTickMarkZone = 0.5
> >
> > res_at_gsnAddCyclic = False
> > res_at_gsnSpreadColors = True
> >
> > res_at_gsnMaximize = True
> >
> > res_at_txFontHeightF = 0.008
> > ;res_at_vcRefMagnitudeF = 4.0 ; define vector ref
> mag
> > ;res_at_vcRefLengthF = 0.055 ; define length of
> vec ref
> > ;res_at_vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector
> > ;res_at_vcRefAnnoArrowLineColor = "black" ; change ref vector
> color
> > ;res_at_vcRefAnnoArrowUseVecColor = False ; don't use vec color
> for ref
> >
> > ; res_at_vcGlyphStyle = "CurlyVector" ; turn on curley
> vectors
> > ; res_at_vcLineArrowColor = "black" ; change vector color
> > ; res_at_vcLineArrowThicknessF = 1.0 ; change vector
> thickness
> > ; res_at_vcVectorDrawOrder = "PostDraw" ; draw vectors last
> > ; res_at_vcFillArrowFillColor = "black"
> >
> >
> >
> > res_at_cnLevelSelectionMode = "ManualLevels" ; set manual contour
> levels
> > res_at_cnMinLevelValF = -0.4 ; set min contour level
> > res_at_cnMaxLevelValF = 1.4 ; set max contour level
> > res_at_cnLevelSpacingF = 0.2 ; set contour spacing
> >
> >
> > plot(0) = gsn_csm_vector_scalar_map(wks,mnu1,mnv1,mntowsp,res)
> > plot(1) = gsn_csm_vector_scalar_map(wks,mnu1,mnv1,mnvcwsp,res)
> > plot(2) = gsn_csm_vector_scalar_map(wks,mnu1,mnv1,mnedwsp,res)
> >
> > resP = True
> > resP_at_gsnPanelLabelBar = True ; add common colorbar
> > ;resP_at_txString = "Westerly phase (phase 7)"
> > resP_at_lbLabelFontHeightF = 0.01
> > resP_at_gsnMaximize = True
> > gsn_panel(wks,plot,(/3,1/),resP)
> >
> > txres = True
> > txres_at_txFontHeightF = 0.015
> > gsn_text_ndc(wks,"Figure 1: a) Total b) Vector c) Eddy " ,0.5,0.02,txres)
> > frame(wks)
> >
> >
> >
> >
> > end
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk_at_ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> --------------------------------------------------------------
> Adam Phillips asphilli_at_ucar.edu
> National Center for Atmospheric Research tel: (303) 497-1726
> ESSL/CGD/CAS fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 16 2006 - 16:44:50 MST

This archive was generated by hypermail 2.2.0 : Sat Nov 18 2006 - 15:30:26 MST