;************************************************ ; Plotting parameters ;************************************************ plot = new (4, "graphic") wks = gsn_open_wks("png","DEC_GEOS-CO-NOx-O3-SO2-Scat-Linear-Regress-colortest") ; send graphics to PNG file resP = True ; modify the panel plot resP@gsnMaximize = True ; maximize plot in frame resP@gsnPanelMainString = "DEC County061-O3-0135-Fall-2016" ; title resP@gsnPanelRowSpec = True ; tell panel what order to plot gsn_panel(wks,plot,(/2,2/),resP) ; wks = gsn_open_wks("png","scatter_regress") ; send graphics to PNG file ;------------ Resources for plotting Urban Sites -------------------- res = True res@gsnDraw = False res@gsnFrame = False res@xyMarkLineModes = (/"Markers","Lines"/) ; choose which have markers res@xyMarkers = 5 ; choose type of marker res@xyMarkerColor = "red" ; Marker color ---Urban Sites res@xyMarkerSizeF = 0.005 ; Marker size (default 0.01) res@xyDashPatterns = 1 ; solid line res@xyLineThicknesses = (/1,2/) ; set second line to 2 res@tmYLFormat = "f" ; not necessary but nicer labels ; res@xyExplicitLegendLables= CORR ;------------- Resources for plotting Suburban Sites --------------------- res2 = True res2@gsnDraw = False res2@gsnFrame = False res2@xyMarkLineModes = (/"Markers","Lines"/) ; choose which have markers res2@xyMarkers = 2 ; choose type of marker res2@xyMarkerColor = "Blue" ; Marker color ---Urban Sites res2@xyMarkerSizeF = 0.005 ; Marker size (default 0.01) res2@xyDashPatterns = 1 ; solid line res2@xyLineThicknesses = (/1,2/) ; set second line to 2 res2@tmYLFormat = "f" ; not necessary but nicer labels ; res2@xyExplicitLegendLables= CORR ;------------ Resources for plotting Rural Sites ------------------------------ res3 = True res3@gsnDraw = False res3@gsnFrame = False res3@xyMarkLineModes = (/"Markers","Lines"/) ; choose which have markers res3@xyMarkers = 3 ; choose type of marker res3@xyMarkerColor = "Green" ; Marker color ---Urban Sites res3@xyMarkerSizeF = 0.005 ; Marker size (default 0.01) res3@xyDashPatterns = 1 ; solid line res3@xyLineThicknesses = (/1,2/) ; set second line to 2 res3@tmYLFormat = "f" ; not necessary but nicer labels ; res3@xyExplicitLegendLables= CORR ;---------------------------------------------------------- ;;;;;;;;;;;;;;;; Plot the Scatter/Linear Regression CO data ;;;;;;;;;;;;;;;;;;;; ;---------------------------------------------------------- res = True txres = True ; label BW line txres@txFontHeightF = 0.0175 ; font height txres@txJust = "CenterCenter" ; Set lable location ; CORR = "R~S~2~N~ = " +R2; R2 is the correlation if (rcl_anova3@b3(0).gt.0) then text0 = " CO = "+ sprintf("%5.3f", rcl_anova0@b3(1))+"*CO + "+sprintf("%5.3f", abs(rcl_anova3@b3(0))) else text0 = " CO = "+ sprintf("%5.3f", rcl_anova3@b3(1))+"*CO - "+sprintf("%5.3f", abs(rcl_anova3@b3(0))) end if plt10 = gsn_csm_xy (wks,x0,pltarry1,res) ; create plot plt1 = gsn_csm_xy (wks,x1,pltarry2,res2) ; create plot plt2 = gsn_csm_xy (wks,x2,pltarry3,res3) ; create plot overlay(plt10,plt1) overlay(plt10,plt2) dum0 = gsn_add_text(wks,plt10,text0, 40, 30,txres) squared0 = gsn_add_text(wks,plt10,"R=" +R, 40, 28,txres) ;---------------------------------------------------------- ;;;;;;;;;;;;;;;; Plot the Scatter/Linear Regression NOx data ;;;;;;;;;;;;;;;;;;;; ;---------------------------------------------------------- res = True txres = True ; label BW line txres@txFontHeightF = 0.0175 ; font height txres@txJust = "CenterCenter" ; Set lable location ; CORR = "R~S~2~N~ = " +R2; R2 is the correlation if (rcl_anova1@b1(0).gt.0) then text1 = " NOx = "+ sprintf("%5.3f", rcl_anova1@b1(1))+"*NOx + "+sprintf("%5.3f", abs(rcl_anova1@b1(0))) else text1 = " NOx = "+ sprintf("%5.3f", rcl_anova1@b1(1))+"*NOx - "+sprintf("%5.3f", abs(rcl_anova1@b1(0))) end if plt11 = gsn_csm_xy (wks,x3,pltarry1,res) ; create plot dum3 = gsn_add_text(wks,plt11,text1, 40, 30,txres) squared1 = gsn_add_text(wks,pl1t11,"R=" +R, 40, 28,txres) ;---------------------------------------------------------- ;;;;;;;;;;;;;;;; Plot the Scatter/Linear Regression O3 data ;;;;;;;;;;;;;;;;;;;; ;---------------------------------------------------------- res = True txres = True ; label BW line txres@txFontHeightF = 0.0175 ; font height txres@txJust = "CenterCenter" ; Set lable location ; CORR = "R~S~2~N~ = " +R2; R2 is the correlation if (rcl_anova2@b2(0).gt.0) then text2 = " O3 = "+ sprintf("%5.3f", rcl_anova2@b2(1))+"*O3 + "+sprintf("%5.3f", abs(rcl_anova2@b2(0))) else text2 = " O3 = "+ sprintf("%5.3f", rcl_anova2@b2(1))+"*O3 - "+sprintf("%5.3f", abs(rcl_anova2@b2(0))) end if plt11 = gsn_csm_xy (wks,x4,pltarry4,res) ; create plot plt5 = gsn_csm_xy (wks,x5,pltarry5,res2) ; create plot plt6 = gsn_csm_xy (wks,x6,pltarry6,res3) ; create plot overlay(plt11,plt5) overlay(plt11,plt6) dum2 = gsn_add_text(wks,plt11,text2, 40, 30,txres) squared2 = gsn_add_text(wks,plt11,"R=" +R, 40, 28,txres) ;---------------------------------------------------------- ;;;;;;;;;;;;;;;; Plot the Scatter/Linear Regression SO2 data ;;;;;;;;;;;;;;;;;;;; ;---------------------------------------------------------- res = True txres = True ; label BW line txres@txFontHeightF = 0.0175 ; font height txres@txJust = "CenterCenter" ; Set lable location ; CORR = "R~S~2~N~ = " +R2; R2 is the correlation if (rcl_anova3@b3(0).gt.0) then text3 = " SO2 = "+ sprintf("%5.3f", rcl_anova3@b3(1))+"*SO2 + "+sprintf("%5.3f", abs(rcl_anova3@b3(0))) else text3 = " SO2 = "+ sprintf("%5.3f", rcl_anova3@b3(1))+"*SO2 - "+sprintf("%5.3f", abs(rcl_anova3@b3(0))) end if plt12 = gsn_csm_xy (wks,x7,pltarry6,res) ; create plot plt8 = gsn_csm_xy (wks,x8,pltarry7,res2) ; create plot plt9 = gsn_csm_xy (wks,x9,pltarry9,res3) ; create plot overlay(plt12,plt8) overlay(plt12,plt9) dum3 = gsn_add_text(wks,plt12,text3, 40, 30,txres) squared3 = gsn_add_text(wks,plt12,"R=" +R, 40, 28,txres) draw(plot) frame(wks) end