Re: Change Major & minor tickmarks

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 17 2012 - 13:35:12 MST

Hi Vanesa,
To be clear, tickmark example 11 shows how to draw 2 sets of XBMajor
tickmarks, not both major and minor. When you set tmXBMode = "Explicit",
the minor tickmarks will get turned off automatically unless you set
tmXBMinorValues.

My advice:
Start off by working on your top plot. Follow the procedure outlined in
tm_11.ncl, setting up your explicit XB tickmarks/labels. You are already
setting up the major labels correctly by doing this:
res2D@tmXBMode = "Explicit"
res2D@tmXBValues = taus
res2D@tmXBLabels = times
and then you pass the resources to tt_res:
tt_res = res2D

What you should see happening now is the major tickmark labels are being
drawn correctly, along with the minor tickmarks not being drawn at all.
(If the major tickmarks are not being drawn correctly you need to modify
your taus/times arrays...)

To get the minor tick marks on the top plot you will have to follow the
coding from tm_11.ncl to create the plot to be overlaid that contains
modified major x-axis labels/tickmarks. Do create a separate resource
list as the example shows.

Once you are happy with the overlay plot, you can do the same type of
thing for your other plots by creating similar blank plots but with
different vp resource settings. Below is an example of what you should
do (untested of course). You will need to come up with your own values
and labels arrays. If you continue to have issues doing this please let
ncl-talk know.

Good luck, Adam
;------------------------------------------------------------------------
ttfill = gsn_contour(wks,tt,tt_res)
windlayer = gsn_vector(wks,ugrid,vgrid,uv_res)
overlay(ttfill,windlayer)

res2 = True
res2@tmXBMode = "Explicit"
res2@tmXBValues = values ; You will have to define these as you
see fit
res2@tmXBLabels = labels ; You will have to define these as you
see fit
res2@tmXBLabelFontHeightF = 0.01 ; Make these labels smaller.
res2@tmXBMajorOutwardLengthF = 0.0 ; Don't draw tickmarks b/c they
res2@tmXBMajorLengthF = 0.0 ; were drawn on previous plot.
res2@tmXBLabelDeltaF = 0.6 ; Move label away from tickmarks.
res2@tmXBLabelFontColor = "Brown"
res2@tmYROn = False ; Turn off right tickmarks.
res2@tmXTOn = False ; Turn off top tickmarks.
res2@tmYLOn = False ; Turn off left tickmarks.

res2@vpXF = res2D@vpXF
res2@vpYF = res2D@vpYF
res2@vpWidthF = res2D@vpWidthF
res2@vpHeightF = res2D@vpHeightF

blank0 = gsn_blank_plot(wks,res2)
overlay(ttfill,blank0)

slp_plot = gsn_csm_xy2(wks,taus,slp_point,hr_point,slp_res,hr_res)
res2@vpXF = res1D@vpXF
res2@vpWidthF = res1D@vpWidthF
res2@vpHeightF = res1D@vpHeightF
res2@vpYF = slp_res@vpYF
blank1 = gsn_blank_plot(wks,res2)
overlay(slp_plot,blank1)

t2_plot = gsn_csm_xy2(wks,taus,t2_point,td2_point,t2_res,td2_res)
res2@vpYF = t2_res@vpYF
blank2 = gsn_blank_plot(wks,res2)
overlay(t2_plot,blank2)

rain_plot = gsn_csm_xy2(wks,taus,rain_point,
arain_point,rain_res,arain_res)
res2@vpYF = rain_res@vpYF
blank3 = gsn_blank_plot(wks,res2)
overlay(rain_plot,blank3)

draw(ttfill)
draw(slp_plot)
draw(t2_plot)
draw(rain_plot)
frame(wks) ; now frame the plot

On 01/16/2012 11:26 AM, Vanesa Bdm wrote:
> Hello: I'm trying to alter the tickmarks in my meteogram just like
> this one
>
> http://www.ncl.ucar.edu/Applications/Scripts/tm_11.ncl
>
> But I don't know how to do that, because I haver 4 plots and this
> scripts re draw the plots.
> I can't imagine how to alter my script so my major tickmark in the
> meteogram show the day (16, 17, 18, 19..) and mi minor tickmark show
> me the hour (1,2,3,4,5,6,7,8,9,10,11,12,13,14..). The day always
> change, but the times don't (minor tickmark).
>
> Could you give me a guide?
> I attach my script.
>
> Regards
>
> Vanesa
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 17 13:35:21 2012

This archive was generated by hypermail 2.1.8 : Wed Jan 18 2012 - 09:21:55 MST