begin x = ispan(-50,50,1) ; 101 points (-50,-49,...,49,50) y = sin(0.0628*x) wks = gsn_open_wks("png","xy1i") ; Open a png file called "xy1i.png". res = True ; Create a variable to hold plot resources. res@gsnMaximize = True ; Maximize plot in frame. res@xyLineColor = "Blue" ; Line color (case insensitive) res@xyLineThicknessF = 2 ; 2x as thick as default res@xyDashPattern = 3 ; Line dash pattern 0 is default (solid) res@xyLabelMode = "Custom" ; Turn on the labeling of the curve. res@xyExplicitLabels = "curvy" ; Label for curve. res@xyLineLabelFontHeightF = 0.02 ; Font height res@tiMainString = "This is a main string" ; Main title res@tiXAxisString = "X Values" ; X axis title res@tiYAxisString = "Reversed Y Values" ; Y axis title res@trYMinF = min(y) ; Set axes limits for res@trYMaxF = max(y) ; both Y and res@trXMinF = min(x) ; X axes. res@trXMaxF = max(x) res@trYReverse = True ; Reverse the Y axis. res@tmXBMode = "Explicit" ; Explicitly set the res@tmXBValues = (/-50, -25, 0, 25, 50/) ; bottom tick mark res@tmXBLabels = (/"A", "B","C", "D","E"/) ; labels. res@tmYROn = False ; Turn off top and res@tmXTOn = False ; right tickmarks. plot = gsn_csm_xy(wks,x,y,res) ; Call the gsn_csm function for drawing ; the curve. end