Re: tmXBValues is not working

From: Will Hobbs <Will.Hobbs_at_nyahnyahspammersnyahnyah>
Date: Sat Dec 21 2013 - 17:20:19 MST

Yi-Cheh

I can't possibly answer that question in detail without knowing more about the y-data that you are trying to plot.

However, put simply you will need to create a dummy array for your time that just gives the month index. Assuming that you have a valid time coord system, you could try this (again, with the caveat that I really don't know what you are trying to plot:

> tdum = cd_calendar(y&time, -5) ; integer array giving year, month,day and time for each data point
>xdum = tdum(:,1) ;integer array of months,numbered 1-12
> res@tmXMinF = 6
> res@tmXMaxF = 9
> res@tmXBMode = "Explicit"
> res@tmXBValues = ispan(6,9,1) ; label indices for Jun-Sep only
> res@tmXBLabels = (/"Jun","Jul","Aug","Sep"/)

>plot = gsn_csm_xy(wks, xdum, y, res)

This is just one way of many of doing what you are trying to do, and may or may not be the most effective given the data you have.

Will

From: Yi-Chih Huang <dscpln@gmail.com<mailto:dscpln@gmail.com>>
Date: Sunday, 22 December 2013 11:10 AM
To: Will Hobbs <will.hobbs@utas.edu.au<mailto:will.hobbs@utas.edu.au>>
Cc: ncl-talk <ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>>
Subject: Re: tmXBValues is not working

Will,

    Thanks for the reply. I don't want 38881-38973 showing up on x axis, but Jun-Sep. How to make sure that x-array in gsn_csm_xy() is within the range of tmXBValues (i.e. 0-3)?

     Thanks much,

             Yi-Chih

On Sun, Dec 22, 2013 at 9:06 AM, Will Hobbs <Will.Hobbs@utas.edu.au<mailto:Will.Hobbs@utas.edu.au>> wrote:
Yi-Chih

Have you ensured that the x-array in gsn_csm_xy() is within the range of tmXBValues (i.e. 0-3)?

Your post is a bit unclear, but it sounds like you have an x-array of 38881-38973, which is outside your plot domain (i.e. 0-3).

Will

From: Yi-Chih Huang <dscpln@gmail.com<mailto:dscpln@gmail.com>>
Date: Sunday, 22 December 2013 10:34 AM
To: ncl-talk <ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>>
Subject: tmXBValues is not working

Hello,

    I am trying to label x axis by the following two sets of commands. However, nothing was labeling on x axis for the first set of commands; The time range [38881..38973] was labeled on x axis for the second set of commands. Could anyone indicate the right commands to label x axis?

  res@tmXBMode = "Explicit"
  res@tmXBValues = ispan(0,3,1)
  res@tmXBLabels = (/"Jun","Jul","Aug","Sep"/)

  res@tmXTMode = "Explicit"
  res@tmXTValues = ispan(0,3,1)
  res@tmXTLabels = (/"Jun","Jul","Aug","Sep"/)

    Thanks much,

              Yi-Chih

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Dec 21 17:20:33 2013

This archive was generated by hypermail 2.1.8 : Mon Jan 06 2014 - 13:02:22 MST