<div dir="ltr"><div class="gmail_default" style="font-size:small">Lyndon,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You might be able to use the time_axis_labels procedure. It does what Dennis suggested, but instead of you having to provide the labels and the values, you tell the procedure what format you want and it should set these resources for you.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><br></div><div class="gmail_default">Right before you call your plotting function, try this:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"> restick = True<br></div><div class="gmail_default"> restick@ttmFormat = "%c"</div><div class="gmail_default"> time_axis_labels(prec&time,res,restick)</div><div class="gmail_default"><br></div><div class="gmail_default">This will attach tmXBValues, tmXBLabels, and tmXBMode to your "res" variable, with the appropriate values.</div><div class="gmail_default"><br></div><div class="gmail_default">This does depend on your "time" array being in the same type of units expected by functions like cd_calendar.</div><div class="gmail_default"><br></div><div class="gmail_default">To see what formats are available, go to:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml">http://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml</a></div><div><br></div><div>Also see some examples at:</div><div><br></div><div><a href="http://www.ncl.ucar.edu/Applications/time_labels.shtml">http://www.ncl.ucar.edu/Applications/time_labels.shtml</a><br></div><div><br></div><div>--Mary</div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 13, 2017 at 10:28 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">That should be:<br><br><pre> res@tmXBMode = "Explicit"
res@tmXBValues = (/3000,3500,4000,.....,8000/) ; whatever
res@tmXBLabels = (/"Jan","Feb",.....,"Dec"/)
</pre><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 13, 2017 at 9:12 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><pre>You will have to put in the correct numbers. ncl-talk has no idea to what the 'time' axis refers refers <br></pre><pre><br> res@tmYLMode = "Explicit"
res@tmYLValues = (/3000,3500,4000,.....,8000/)
res@tmYLLabels = (/"Jan","Feb",.....,"Dec"/)
</pre></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_6925548944524748725h5">On Thu, Jan 12, 2017 at 11:16 PM, Lyndon Mark Olaguera <span dir="ltr"><<a href="mailto:olagueralyndonmark429@gmail.com" target="_blank">olagueralyndonmark429@gmail.c<wbr>om</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_6925548944524748725h5"><div dir="ltr">Hi All,<div><br></div><div>I'm plotting a wavelet based from this example <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/wavelet.shtml" target="_blank">https://www.ncl.ucar.e<wbr>du/Document/Functions/Built-in<wbr>/wavelet.shtml</a></div><div><br></div><div>Is there an easy way to make the x-axis in terms of months (Jan to Dec)?</div><div><br></div><div>Here's my code:</div><div><br></div><div><div>begin</div><div>;*****************************<wbr>*******</div><div>; create pointer to file and read in variables</div><div>;*****************************<wbr>*******</div><div> f = addfile ("hpass_SCS.nc","r")</div><div> prec = f->PREC(:,0,0) ; one value/year</div><div> time = prec&time</div><div> N = dimsizes(time)</div><div>;*****************************<wbr>*******</div><div>; Remove mean and linear trend (recommended, not required)</div><div>; Missing values are not allowed.</div><div>;*****************************<wbr>*******</div><div> prec = dtrend(prec,False)</div><div>;*****************************<wbr>*******</div><div>; compute wavelet (Missing values not allowed due to use of FFT)</div><div>;*****************************<wbr>*******</div><div> mother = 0</div><div> param = 6.0</div><div> dt = 1.</div><div> s0 = 0.25</div><div> dj = 0.25</div><div> jtot = 44</div><div> npad = N</div><div> nadof = new(2,float)</div><div> noise = 1</div><div> siglvl = .05</div><div> isigtest= 1</div><div><br></div><div> w = wavelet(prec,mother,dt,param,s<wbr>0,dj,jtot,npad,noise,isigtest,<wbr>siglvl,nadof)</div><div>;*****************************<wbr>*******</div><div>; create coodinate arrays for plot</div><div>;*****************************<wbr>*******</div><div> power = onedtond(w@power,(/jtot,N/))</div><div> power!0 = "period" ; Y axis</div><div> power&period = w@period</div><div><br></div><div> power!1 = "time" ; X axis</div><div> power&time = time</div><div><br></div><div> power@long_name = "Power Spectrum"</div><div> power@units = "unit^2"</div></div><div><br></div><div><br></div><div><div>;*****************************<wbr>*******</div><div>; initial resource settings</div><div>;*****************************<wbr>*******</div><div> wks = gsn_open_wks("png","wavelet") ; send graphics to PNG file</div><div> res = True ; plot mods desired</div><div> res@cnFillOn = True ; turn on color</div><div> res@cnFillPalette = "BlAqGrYeOrReVi200" ; set color map</div><div> res@cnFillMode = "RasterFill" ; turn on raster mode</div><div> res@cnRasterSmoothingOn = True ; turn on raster smoothing</div><div> res@cnLinesOn = False ; turn off contour lines</div><div> res@lbOrientation = "Vertical" ; vertical label bar</div><div> res@trYReverse = True ; reverse y-axis</div><div> ;res@tmLabelAutoStride = True</div><div> res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels</div><div> res@cnMinLevelValF = 0.0 ; set min contour level</div><div> res@gsnLeftString = "Wavelet Power"</div><div> plot = gsn_csm_contour(wks,power({0:1<wbr>20},:),res)</div><div>end</div></div><div><br></div><div><br></div><div>I'll appreciate any help.</div><div><br></div><div>Many thanks,</div><div><br></div><div><br></div></div>
<br></div></div>______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>