begin f = addfile ("atmos2.nc", "r") ; Open data file and pull off U, T U = f->U(0,0:1,{30},:) ; data at the first two T = f->T(0,0:1,{30},:) ; levels and latitude = 30. wks = gsn_open_wks("png","xy4d") ; Open a png file called "xy4d.png". res = True ; Resources common to both sets of curves res@xyMonoDashPattern = True ; Single dash pattern for curves res@xyLineThicknessF = 2 ; Common line thickness for curves res@xyLineColors = (/"purple","red"/) resU = res ; Plot options desired resT = res ; Plot options desired resU@gsnMaximize = True ; Maximize plot in frame. resU@vpWidthF = 0.6 ; Make plot wider than height resU@vpHeightF = 0.4 ; gsnMaximize will preserve aspect ratio. resU@trXMinF = min(U&lon) ; Limits for X axis resU@trXMaxF = max(U&lon) resU@xyDashPattern = 0 ; Solid line. resT@xyDashPattern = 1 ; Dashed line. resU@tiYAxisString = U@long_name + " (solid)" resT@tiYAxisString = T@long_name + " (dash)" plot = gsn_csm_xy2(wks,U&lon,U,T,resU,resT) ; Call gsn_csm_xy2 to generate ; XY plot with two Y axes. end