<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif"><div class="gmail_default" style="font-size:12.8px">Hi</div><div class="gmail_default" style="font-size:12.8px"><br></div><div class="gmail_default" style="font-size:12.8px">I am trying to plot an nc file having anomaly time series for the JJAS season. I have tried to follow the sample scripts over the NCL web resource, but could not succeed in getting the correct labels of time (year) on the X axis.</div><div class="gmail_default" style="font-size:12.8px"><br></div><div class="gmail_default" style="font-size:12.8px">Would appreciate if anybody could help...</div><div class="gmail_default" style="font-size:12.8px">the script is as following- </div><div class="gmail_default" style="font-size:12.8px"><br></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.8px"><div class="gmail_default"><font face="georgia, serif">begin</font></div><div class="gmail_default"><font face="georgia, serif"> f = addfile ("<a href="http://std_tim_anomaly.nc/" target="_blank">std_tim_anomaly.nc</a>", "r") ; add file</font></div><div class="gmail_default"><font face="georgia, serif"> date = f->time</font></div><div class="gmail_default"><font face="georgia, serif"> printVarSummary(date)</font></div><div class="gmail_default"><font face="georgia, serif"> precip= f->tp(:,0,0)</font></div><div class="gmail_default"><font face="georgia, serif"> printVarSummary(precip)</font></div><div class="gmail_default"><font face="georgia, serif"> </font></div><div class="gmail_default"><font face="georgia, serif"> dimDate = dimsizes(date) ; number of dates</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">; convert integer YYYYMM to float</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif"> dateF = new (dimDate, float) </font></div><div class="gmail_default"><font face="georgia, serif"> do n=0,dimDate-1 </font></div><div class="gmail_default"><font face="georgia, serif"> yyyy = date(n)/100 </font></div><div class="gmail_default"><font face="georgia, serif"> mon = date(n)-yyyy*100</font></div><div class="gmail_default"><font face="georgia, serif"> dateF(n) = tofloat(yyyy + (mon-1)/12.) </font></div><div class="gmail_default"><font face="georgia, serif"> end do</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">;*****************************<wbr>****</font></div><div class="gmail_default"><font face="georgia, serif">; create plot</font></div><div class="gmail_default"><font face="georgia, serif">;*****************************<wbr>***</font></div><div class="gmail_default"><font face="georgia, serif"> wks = gsn_open_wks ("ps", "bar" ) ; send graphics to PS file</font></div><div class="gmail_default"><font face="georgia, serif"> res = True ; plot mods desired</font></div><div class="gmail_default"><font face="georgia, serif"> res@gsnScale = True </font></div><div class="gmail_default"><font face="georgia, serif"> </font></div><div class="gmail_default"><font face="georgia, serif">; these four resources allow the user to stretch the plot size, and</font></div><div class="gmail_default"><font face="georgia, serif">; decide exactly where on the page to draw it.</font></div><div class="gmail_default"><font face="georgia, serif"> </font></div><div class="gmail_default"><font face="georgia, serif"> res@vpXF = 0.10 ; In page coordinates, where to start</font></div><div class="gmail_default"><font face="georgia, serif"> res@vpYF = 0.75 ; the plot</font></div><div class="gmail_default"><font face="georgia, serif"> res@vpHeightF = 0.43 ; Changes the aspect ratio</font></div><div class="gmail_default"><font face="georgia, serif"> res@vpWidthF = 0.85</font></div><div class="gmail_default"><font face="georgia, serif"> </font></div><div class="gmail_default"><font face="georgia, serif"> res@trYMinF = -3.0 ; min value on y-axis</font></div><div class="gmail_default"><font face="georgia, serif"> res@trYMaxF = 3.0 ; max value on y-axis</font></div><div class="gmail_default"><font face="georgia, serif"> </font></div><div class="gmail_default"><font face="georgia, serif"> res@tiYAxisString = "Anomalies" ; y-axis label </font></div><div class="gmail_default"><font face="georgia, serif">; this resource changes a regular line plot to a bar chart</font></div><div class="gmail_default"><font face="georgia, serif"> res@gsnXYBarChart = True ; create bar chart </font></div><div class="gmail_default"><font face="georgia, serif">; this resource is required to get bars above and below a reference line</font></div><div class="gmail_default"><font face="georgia, serif"> res@gsnYRefLine = 0. ; reference line </font></div><div class="gmail_default"><font face="georgia, serif"> res@gsnXYBarChart = True ; create bar chart </font></div><div class="gmail_default"><font face="georgia, serif"> res@gsnAboveYRefLineColor = "red" ; above ref line fill red</font></div><div class="gmail_default"><font face="georgia, serif"> res@gsnBelowYRefLineColor = "blue" ; below ref line fill blue</font></div><div class="gmail_default"><font face="georgia, serif"> res@gsnXYBarChartBarWidth = 24.0</font></div><div class="gmail_default"><font face="georgia, serif"> plot = gsn_csm_xy (wks,dateF(::),precip,res)</font></div><div class="gmail_default"><font face="georgia, serif">end</font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif"><img src="cid:ii_1596f07b17109416" alt="Inline image 1" width="524" height="285" class="gmail-CToWUd gmail-a6T" tabindex="0"></font><span style="font-family:georgia,serif">this is the plot which is being created.</span><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif"><br></font></div><div class="gmail_default"><font face="georgia, serif">Thanks in anticipation.</font></div></div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">========================================</div><div dir="ltr">Dhirendra Kumar<div>PhD Student<br></div><div>School of Environmental Sciences, JNU<br></div><div>New Delhi (India)</div><div>Contact: <font face="comic sans ms, sans-serif">+91 9910778043</font></div><div>Alternate email: <a href="mailto:dhirendra.cub@outlook.com" target="_blank">dhirendra.cub@outlook.com</a></div><div>=========================================</div></div></div></div></div></div></div></div></div></div></div>
</div>