help with tickmarks on gsn_csm_y plots

From: Kerrie Geil <kgeil_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 22 2012 - 13:33:20 MDT

Currently, the code snippet below produces a panel plot of 22 gsn_csm_y
plots showing average daily precipitation over a certain time period, for a
certain location, for various climate models. On each gsn_csm_y plot, the
bottom x-axis has a tickmark and a MMDD time label for each day from Mar 1
to Jul 31. I'm having trouble figuring out how to get the x-axis
tickmarks the way I want. What I want to do is only have a tickmark at Apr
1, May 1, Jun 1, and Jul 1. I'll remove the time labels and add the
appropriate months as text between the tick marks below the axis. Can
anyone help me with which resources to use in order to only show these few
tickmarks?

Thanks in advance,
Kerrie

...
wks=gsn_open_wks(type,"plots/PR_TIMEAVG_"+box(ibox))
plot(nmodels)=gsn_csm_y(wks,pr_timeavgdata,res)

delete([/res,timeMMDD_str/])

startyear=toint(str_get_cols(timerange,0,3))
endyear=toint(str_get_cols(timerange,5,8))
nyears=toint(endyear)-toint(startyear)+1

do imodel=0,nmodels-1
    print("MODEL= "+models(imodel))
    ndays =
numAsciiCol("pr_textfiles/"+models(imodel)+"_YYYYMMDDtime_"+timerange)

model_time=asciiread("pr_textfiles/"+models(imodel)+"_YYYYMMDDtime_"+timerange,(/nyears,ndays/),"integer")
    model_time_str=tostring(model_time)
    indices=ind( (toint(str_get_cols(model_time_str(0,:),4,5)).ge.3) .and.
(toint(str_get_cols(model_time_str(0,:),4,5)).le.7) )

pr_avgbox1=asciiread("pr_textfiles/"+box(ibox)+"_"+models(imodel)+"_Daily_"+timerange,(/nyears,ndays/),"float")
    pr_avgbox2=pr_avgbox1(:,indices)
    pr_timeavgmodel=dim_avg_n_Wrap(pr_avgbox2,0)
    timeMMDD_str=str_get_cols(model_time_str(0,indices),4,7)

    res=True
    res@gsnMaximize=True
    res@gsnDraw=False
    res@gsnFrame=False
    res@tmXBMode="Explicit"
    res@tmXBValues=ispan(0,dimsizes(timeMMDD_str)-1,1)
    res@tmXBLabels=timeMMDD_str
    res@tmXBLabelAngleF=270.
    res@tmXBLabelFontHeightF=0.01
    res@tmBorderThicknessF=1.5
    res@tmXTOn=False
    res@trXMinF = 0.0
    res@trXMaxF = max(res@tmXBValues)
    res@trYMinF = 0.0
    res@trYMaxF = 6.0
    res@gsnYRefLine=threshold
    res@gsnYRefLineDashPattern=2
    res@gsnYRefLineThicknessF=1.25
    res@gsnCenterString=models(imodel)

    plot(imodel)=gsn_csm_y(wks,pr_timeavgmodel,res)

delete([/model_time,model_time_str,indices,pr_avgbox1,pr_avgbox2,pr_timeavgmodel,timeMMDD_str,res/])
end do ;### model loop

print("creating panel plot")
pres=True
pres@gsnPanelRowSpec = True
pres@gsnMaximize=True

gsn_panel(wks,plot,(/4,4,4,4,4,2/),pres)
...

-- 
Kerrie Geil
Master's Student
Department of Atmospheric Sciences
University of Arizona
PAS Building Rm 526
1118 E 4th Street
Tucson, AZ 85721

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 22 13:33:29 2012

This archive was generated by hypermail 2.1.8 : Mon Jun 25 2012 - 09:57:23 MDT