Am trying to plot the the graph of Argo Floats versus temp difference but the codes I wrote is generating some errors at the moment. Can some please guide me with this? The coding is given below:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
;----------------------------------------------------------------------
; Data is hard-coded here. It was originally calculated by running
; a compute-intensive script.
;----------------------------------------------------------------------
floatnames = (/"A","B","C","D","E","F","G"/)
AB = (/-0.477,0,-1.142,-1.032,0.278,0.664,5.819/)
;B2B1 = (/0,0,-0.482,0,-0.257,0.107,0/)
;A2A1 = (/0.217,0,-0.66,0.813,0,0.537,-6.024/)
;----------------------------------------------------------------------
; Open a PS file and define the color table
;----------------------------------------------------------------------
colors = (/"blue","green","red"/)
wks = gsn_open_wks ("ps","scatter")
gsn_define_colormap(wks,colors)
;----------------------------------------------------------------------
; Set some plot resources
;----------------------------------------------------------------------
res = True
res@gsnDraw = False ; Don't draw plot
res@gsnFrame = False ; Don't advance frame
;
; Don't use gsnMaximize. Instead, we will control
; exactly where plot goes.
;
res@vpXF = 0.2
res@vpYF = 0.85
res@vpWidthF = 0.5
res@vpHeightF = 0.5
;---Some calculations to get min/max for Y axis.
miny = min(AB)
maxy = max(AB)
;minx = min(floatnames)
;maxx = max(floatnames)
amaxy = maxy - abs(miny)
amaxy = amaxy / 2.
amaxy = amaxy + 25.
aminy = maxy - abs(miny)
aminy = aminy / 2.
aminy = aminy - 25.
;---Resources for X/Y axes.
res@trYMinF = aminy ; min value on y-axis
res@trYMaxF = amaxy ; max value on y-axis
;res@trXMinF = 0. ; min value on x-axis
;res@trXMaxF = 5. ; max value on x-axis
;---XY marker resources
res@xyMarkLineMode = "Markers"
res@xyMarkerSizeF = 0.03
res@xyMarkerThicknessF = 3.
res@xyMonoMarkerColor = False ; Allow different colors for markers
res@xyMarkerColors = colors(2:) ; It's okay to list more than
; you need here
res@xyMarkers = (/4,4,4,7,7,7,3,6,6/)
;---Tickmark resources
res@tmXBMode = "Manual"
res@tmYLMode = "Manual"
res@tmXBTickSpacingF = 1.
res@tmYLTickSpacingF = 5.
;---Title resources
res@tiMainString = "30 av Annual % Change P vs Delta T~C~" + \
" for the WetSouth"
res@tiXAxisString = "Delta T"
res@tiYAxisString = "% Change P"
res@tiMainFontHeightF = 0.03
;----------------------------------------------------------------------
; Create the scatter plot, but don't draw it yet.
;----------------------------------------------------------------------
plot = gsn_csm_xy (wks,transpose((/floatnames,floatnames/)), \
transpose((/AB,AB/)),res)
;----------------------------------------------------------------------
; Draw time stamp first, then the plot.
;----------------------------------------------------------------------
infoTimeStamp(wks,0.005,"")
draw(plot)
frame(wks) ; Now advance the frame.
end
Sachin Ravilesh Nand | Software Engineer (Consultant)
B.C.A (Bangalore University-India)
European Union Global Climate Change Alliance Project.
Pacific Centre for Environment and Sustainable Development.
University of the South Pacific.
E: sachin.nand@usp.ac.fj<mailto:sachin.nand@usp.ac.fj>
T: (+679) 32 32205
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 29 14:43:26 2013
This archive was generated by hypermail 2.1.8 : Thu May 02 2013 - 11:16:45 MDT