<div dir="ltr"><div><div><div>Hi Ipshita,<br></div>Please only respond to the ncl-talk list and not to me personally when corresponding on NCL issues. That way the community can assist and/or see whether an issue is resolved.<br>
<br></div>In your reply you stated "I did use two gsn_csm_xy plots in my code but still it overlaps. I used
the above example #9 to write it."<br><br></div><div>It does help all of us help you when you send the plot with the issue, and in this case it revealed three things:<br><br></div><div>1) My initial response to you was correct: "You will want to adjust your months array in your two gsn_csm_xy calls to be different from one another as it is done in the example. Otherwise your bars will overlap." You are inputting the exact same x-axis array into both gsn_csm_xy calls. That is telling NCL to draw the bars in the <i>exact same location</i>. You will need to alter your months array to account for this in one or both of your gsn_csm_xy calls.<br>
<br></div><div>2) You may want to restrict the y-axis range of your plots. You can do this by using the trYMinF and trYMaxF resources:<br>sres@trYMinF = 0.<br></div><div>sres@trYMaxF = 2800.<br></div><div>
<br></div><div>You will need to set trYMinF and trYMaxF for each plot separately.<br><br></div><div>3) You will likely have to adjust the Y-axis labels. See the bottom panel of example #2 here: <a href="http://www.ncl.ucar.edu/Applications/tickmarks.shtml#ex2">http://www.ncl.ucar.edu/Applications/tickmarks.shtml#ex2</a><br>
</div><div><br></div><div>Hope that helps. If not, please respond to the ncl-talk email list.<br></div><div>Adam<br></div><div><br>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 3:56 PM, Ipshita Majhi <span dir="ltr"><<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.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"><div><div><div><div>Hi,<br></div>I want to plot trend values and monthly means in one plot. Both are an array of size 12 .<br>
</div>The program gives no error but the plot are overlapping. I am not sure how to fix it<br>
;*****************************************************<br>;Trend and monthly climatology together in one bar plot<br>;*******************************************************<br> <br> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br> <br> months=(/1,2,3,4,5,6,7,8,9,10,11,12/)<br><br> monthly_avg=asciiread("~/Documents/PhD_June_2015/NCL_Moonsoon/Data_output/Monthly_avg_air.txt",-1, "float")<br>
monthly_Trend=asciiread("~/Documents/PhD_June_2015/NCL_Moonsoon/Data_output/trend_air.txt", -1, "float")<br> printVarSummary(monthly_avg)<br> <br> wks = gsn_open_wks("ps","Trend_Avg")<br>
<br> <br> sres = True<br> sres@vpWidthF = 0.7<br> sres@vpHeightF = 0.5<br> sres@gsnDraw = True<br> sres@gsnFrame = False<br> sres@gsnXYBarChart = True<br> sres@gsnXYBarChartBarWidth = 0.15 ; change bar widths<br>
sres@tmXBMode = "Explicit" ; explicit labels<br> sres@tmXBValues = (/1,2,3,4,5,6,7,8,9,10,11,12/)<br> sres@tmXBLabels = (/"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"/)<br>
sres@tmXBLabelFontHeightF = 0.0205<br> sres@tmXTLabelFontHeightF = 0.0205<br> sres@tmYLLabelFontHeightF = 0.0225<br> sres@tiMainFontHeightF = 0.025<br> sres@tiMainFont = "helvetica"<br> sres@tiMainString = "All India Rainfall Climatology and Trend 1880-2012"<br>
sres@tiYAxisString = "(mm)"<br><br> plot1 = gsn_csm_xy (wks,months,monthly_avg,sres) <br> sres@gsnXYBarChartColors = (/"red"/) ; seperately, not<br> plot2 = gsn_csm_xy(wks,months,monthly_Trend,sres) ; advancing the frame<br>
sres@gsnXYBarChartColors = (/"blue"/) ; but tweaking where<br> <br><br> ;*******************************************************<br><br></div>Can someone suggest what steps to take<span class="HOEnZb"><font color="#888888"><br>
</font></span></div><span class="HOEnZb"><font color="#888888">Ipshita<br></font></span></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Division, NCAR<br>
</font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div>
<span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div>
</div>
</div></div>
</div>