<div dir="ltr"><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. I realized that if I use the below mentioned method they overlap is there a way to have two y axis in bar plots. Since the trends are much smaller then avgs.<br>
<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></div>