[ncl-talk] time_axis_labels: no labels produced in attached plots

Elizabeth Burakowski burakows at ucar.edu
Thu Jul 24 14:44:46 MDT 2014


Hello Arindam,

Thank you for the suggestion.  I found that converting ts_10&DateTime from
"yyyymmddhh" to "hours since 2008-11-01 00:00:00" using wrf_times_c
<http://www.ncl.ucar.edu/Document/Functions/WRF_contributed/wrf_times_c.shtml>
and option 0 helped the labels to appear correctly on the x-axis.

Cheers,

Liz.





On Wed, Jul 23, 2014 at 5:36 AM, Arindam Chakraborty <arch13 at gmail.com>
wrote:

> HI,
>  Unless ts_10&DateTime has a "units" attribute, time_axis_label cannot
> convert the YYYYMMDD format to proper time format. You may need to create a
> time array using cd_inv_calendar() and send that to time_axis_label().
>
> regards,
> --
> *Arindam Chakraborty*
> CAOS, IISc, Bangalore-12
>
>
> On Wed, Jul 23, 2014 at 4:13 AM, Elizabeth Burakowski <burakows at ucar.edu>
> wrote:
>
>> Hello,
>>
>> I am trying to use time_axis_labels to produce x-axis labels in a
>> YYYYMMDD format for the bottom axis of 10 attached plots.  I am using example
>> 6
>> <https://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml>
>> on the time_axis_labels page.
>>
>> When I run my script, I do not receive any errors, however, I also do not
>> see any x-axis labels on my plot.  The relevant portions of my script are
>> below.  I can send along the full script if needed but I believe the below
>> contains the relevant portions for sake of keeping it short.
>>
>> Thanks,
>>
>> Liz.
>>
>>
>> t = ispan(0,1447,1)
>>
>> printVarSummary(ts_10)
>> Variable: ts_10
>> Type: float
>> Total Size: 23168 bytes
>>             5792 values
>> Number of Dimensions: 2
>> Dimensions and sizes: [4] x [DateTime | 1448]
>> Coordinates:
>>             DateTime: [2008110100..2009043021]
>> Number Of Attributes: 1
>>   _FillValue : 9.96921e+36
>>
>> wks = gsn_open_wks("ps","WRF_ts_CLM")
>>
>> res = True
>> res at gsnDraw = False
>> res at gsnFrame = False
>>
>> ;----X-Axis formatting
>> res at tmXTOn = False
>> res at tmXBOn = True
>> res at tmXLabelAngleF = 90
>>
>> ;----X-Axis labels
>> res at tmXBMode = "Manual"
>> restick = True
>> restick at ttmFormat = "%Y %N %D"
>> restick at ttmAxis = "XB"
>> restick at ttmMajorStride = 181
>>
>> time_axis_labels(ts_10&DateTime,res,restick)
>>
>> res at tiYAxisString = "Top soil layer"
>> xy1 = gsn_csm_xy(wks,t,ts_01,res)
>>
>> res at tiYAxisString = "Middle soil layer"
>> xy2 = gsn_csm_xy(wks,t,ts_02,res)
>>
>> ....
>>
>> res at tiYAxisString = "Bottom soil layer"
>> xy10 = gsn_csm_xy(wks,t,ts_10,res)
>>
>> res1 = True
>> res2 = True
>> res2 at gsnAttachPlotsXAxis = True
>>
>> plot = gsn_attach_plots(xy1,(/xy2,...,xy10/),res1,res2)  ; There are 10
>> plots total, shortened to three in this example.
>>
>> draw(xy1)
>> frame(wks)
>>
>>
>> Thanks,
>> Liz.
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140724/04cbc9b0/attachment.html 


More information about the ncl-talk mailing list