<div dir="ltr">Hi:<div><br></div><div>Look within for how I extract year, month, etc, and then use it to obtain the time-var (just day and time, but you can add back the month). </div><div><br></div><div>I then write some fraction of the times on the xaxis.</div><div><br></div><div>Barry</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 11, 2019 at 12:52 PM Zilore Mumba <<a href="mailto:zmumba@gmail.com">zmumba@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">thanks Barry, you can please send me the code. i will appreciate.<div>Good day</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 11, 2019 at 11:23 AM Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Zilore:<div><br></div><div>If you are "simply" trying to put time information on your xaxis, then I can probably send you the code to do it. It is a few more lines than what you are using, but if you can separate out the year, month, day, etc from the string, then it is straightforward to use. </div><div><br></div><div>Barry</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 11, 2019 at 12:09 PM Zilore Mumba <<a href="mailto:zmumba@gmail.com" target="_blank">zmumba@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Sorry, my intention is not to cause any confusion. I did load the package. What I was requesting is assistance on whether I called the package with the correct arguments.</div><div>My sincere apologies if I have caused any wasted time or irirtation.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 11, 2019 at 1:14 AM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>I'm confused by this thread -- where does cd_string enter? I don't see it referenced in the script.<br></div><div><br></div><div>If the error messages are saying time_axis_labels is undefined, then as Dave has pointed out, the docs say to load:</div><div><br></div><div><pre>load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"<br><br></pre><pre>See:<br><br><a href="http://ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml" target="_blank">http://ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml</a><br><br></pre><pre>Rick<br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 10, 2019 at 3:07 PM Zilore Mumba via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks Barry, I did not realise that the contribute script I used was from WRF.</div><div>However even with the right script I still get the same error. Perhaps you could help me, look at the script and see where am doing it wrong, especially where I use cd_calendar and date&time.</div><div>The script is below. I know it is cumbersome because you do not have my data. But I will appreciate any help</div><div>;-----------------------------------------------------------------<br>; Adapted from DKRZ - NCL Example: NCL_xy_multiple_lines_axis.ncl<br>;-----------------------------------------------------------------<br><br>load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"<br><br>begin<br><br> filein = "/home/zmumba/DATA/tasmax_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19960101-20001231.nc" ; file name<br><br> f = addfile(filein,"r") ; open file<br><br> tmax = f->tasmax(:,{-15},{25}) ; read tmax, all timesteps, 15S/25E<br><br> t = f->time ; for use in x-axis label<br> cd_date = cd_calendar(t, -2)<br><br>; open a workstation<br> wks_type = "X11" ; graphics output type<br> wks_type@wkWidth = 1024 ; graphics output width in pixels<br> wks_type@wkHeight = 1024 ; graphics output height in pixels<br><br> wks = gsn_open_wks(wks_type, "plot_xy_tie_series")<br><br>; resources for variable tmax y-axis<br> res = True <br> res@xyLineThicknessF = 3.0 ; set line thickness<br> res@xyLineColor = "red" ; set line color<br> res@xyDashPatterns = 0 ; solid line<br> res@tmXBLabelFontHeightF = 0.010<br> res@tiYAxisString = "Daily Max. 2m" + " " + tmax@standard_name +" "+ "at 15S/25E" ; axis string<br><br> restick = True ; resource object<br> restick@ttmFormat = "%d %c"<br> restick@ttmAxis = "YL"<br> restick@ttmMajorStride = 20<br> restick@ttmValues = cd_date<br><br> time_axis_labels(date&time,res,restick)<br><br>; create the plot<br> plot = gsn_csm_xy(wks, t, tmax, res)<br> <br>end</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 9, 2019 at 7:33 PM Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Try this one.<div><br></div><div>
<p class="gmail-m_6214565852403941782gmail-m_-4103928638595058460gmail-m_-82883221540926853gmail-m_113451060548281442gmail-m_622222959240055201gmail-m_5863356067459985293gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:19px;line-height:normal;font-family:"Courier New";color:rgb(0,0,0)"><span class="gmail-m_6214565852403941782gmail-m_-4103928638595058460gmail-m_-82883221540926853gmail-m_113451060548281442gmail-m_622222959240055201gmail-m_5863356067459985293gmail-s1" style="font-variant-ligatures:no-common-ligatures">load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"</span></p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 9, 2019 at 7:18 PM Dave Allured - NOAA Affiliate via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>That is not the correct load command for this function. Time_axis_labels is loaded separately. Please go to the documentation page for time_axis_labels, find the correct load command at the top of that page, and add it to your script.<br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 9, 2019 at 12:27 AM Zilore Mumba <<a href="mailto:zmumba@gmail.com" target="_blank">zmumba@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks Dave for the hint. i did load the contributed package. I still get the same error. The package I loaded is "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"</div><div>When I check this script I do not see anywhere where there is a function like "time_axis_labels".</div><div>I will continue to probe and see where am going wrong</div><div>Incidentally, example6 on <a href="https://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml</a>, gives <br><pre><strong>time_axis_labels</strong>( data&time, res, restick )<br></pre><pre>I assumed there was a mistake on data&time and corrected it to <br><strong>time_axis_labels</strong>( date&time, res, restick )<br></pre><pre>Thanks<br></pre><pre>Zilore<br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 8, 2019 at 10:00 PM Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>This is one of the contributed functions that is not loaded automatically. You are missing a "load" command. NCL gave you a clue: "possibly an undefined procedure". Please look at the top of the function documentation page.</div><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 8, 2019 at 9:14 AM Zilore Mumba via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I am trying to plot a time series. I have converted the dates in the file to the format YYYYMMDD with the function <br></div><div> t = f->time ; to get time in file<br> cd_date = cd_calendar(t, -2) ; print(cd_date) prints correctly, eg 19960101,...</div><div>Then to prepare the format for the x-axis label, I have:</div><div><pre> resT1 = true<br></pre><pre> some resources<br> ..............<br></pre><pre> restick = True
restick@ttmFormat = "%d %c"
restick@ttmAxis = "YL"
restick@ttmMajorStride = 20
<strong>time_axis_labels</strong>( data&time, res, restick )<br><br></pre><pre>I am getting the error:<br>fatal:syntax error: line 57 in file two-line-plot.ncl before or near \n <br> time_axis_labels( data&time, resT1, restick )<br>-------------------------------------------------^<br><br>fatal:syntax error: possibly an undefined procedure<br>fatal:syntax error: line 72 in file two-line-plot.ncl before or near \n <br> time_axis_labels(cd_date,resT1,restick)<br>------------------------------------------^<br><br>fatal:syntax error: possibly an undefined procedure<br>fatal:Syntax Error in block, block not executed<br>fatal:error at line 76 in file two-line-plot.ncl<br><br></pre><pre>Is the <br><strong>time_axis_labels function still valid, or is there an alternative function?<br></strong></pre><pre><strong>Help will be appreciated.<br></strong></pre><pre><strong>Zilore</strong></pre></div></div></blockquote></div></div></div>
</blockquote></div>
</blockquote></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_6214565852403941782gmail-m_-4103928638595058460gmail-m_-82883221540926853gmail-m_113451060548281442gmail-m_622222959240055201gmail-m_5863356067459985293gmail_signature"><div dir="ltr"><div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Associate Scientist, Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div>
</blockquote></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_6214565852403941782gmail-m_-4103928638595058460gmail_signature"><div dir="ltr"><div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Associate Scientist, Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Associate Scientist, Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div>