[ncl-talk] custom string labels in time-axis
Adam Phillips
asphilli at ucar.edu
Wed Nov 14 15:46:40 MST 2018
Hi Tabish,
My note about setting tmXBValues was made as users who haven't set
tmXBValues before can run into trouble (and not get any labels whatsoever)
if the range of values of tmXBValues does not overlap with the x input to
gsn_csm_xy.
You can set tmXBLabels to whatever you want, but make sure the range of
values specified in tmXBValues is in the range of the 2nd input of
gsn_csm_xy (as it is in the example coding below):
res at tmXBMode = "Explicit"
res at tmXBValues = (/1,25,49,73/)
res at tmXBLabels = (/"Day 1","Day 2","Day 3","Day 4"/)
plot = gsn_csm_xy(wks,ispan(1,97,1),arr,res)
Adam
On Wed, Nov 14, 2018 at 3:39 PM Tabish Ansari <tabishumaransari at gmail.com>
wrote:
> Hi Adam,
>
> Thanks for the reply.
>
> The issue here is that I have 10 lines (arrays of length 120 hours) within
> a single xy plot
> and these arrays don't correspond in time - they have different starting
> and ending dates.
> Nevertheless, for the purpose of my analysis, I want to show them stacked
> over each other
> since they're of the same length.
>
> So I need *exactly* these major tickmark labels: "Day1, Day2, Day3, Day4,
> Day5" at the 1st, 25th, 49th, 73rd and 97th hours
> on the x-axis.
>
>
> Cheers,
>
> Tabish
>
>
> Tabish U Ansari
> PhD student, Lancaster Environment Center
> Lancaster Univeristy
> Bailrigg, Lancaster,
> LA1 4YW, United Kingdom
>
>
> On Wed, 14 Nov 2018 at 22:19, Adam Phillips <asphilli at ucar.edu> wrote:
>
>> Hi Tabish,
>> Yes, see tickmark example 2 here:
>> http://www.ncl.ucar.edu/Applications/tickmarks.shtml#ex2
>>
>> Note though that the values set in tmXBValues must be within the range of
>> times specified in the x-input in gsn_csm_xy. For example, if you create
>> your plot like this:
>> plot(1) = gsn_csm_xy(wks,ispan(1950,2005,1),arr,res)
>> your times run from 1950 to 2005, and your tmXBValues need to be set
>> within that range.
>>
>> If you have any further questions let ncl-talk know.
>> Adam
>>
>>
>> On Wed, Nov 14, 2018 at 3:13 PM Tabish Ansari <tabishumaransari at gmail.com>
>> wrote:
>>
>>> Hi
>>>
>>> I'm plotting arrays of length 120 through gsn_csm_xy() function.
>>> I've been using time_axis_labels function before but this time it's a
>>> slightly different
>>> situation and I want my x-axis to be labelled as:
>>> Day1, Day2, Day3, Day4, Day5
>>> every 24th hour along the 120 hours.
>>>
>>> Is it possible to do this?
>>>
>>> Thanks
>>>
>>> Tabish
>>>
>>> Tabish U Ansari
>>> PhD student, Lancaster Environment Center
>>> Lancaster Univeristy
>>> Bailrigg, Lancaster,
>>> LA1 4YW, United Kingdom
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>> --
>> Adam Phillips
>> Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
>> www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
>>
>> <http://www.cgd.ucar.edu/staff/asphilli>
>>
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181114/f7af609d/attachment.html>
More information about the ncl-talk
mailing list