Merging two XY plot

From: nand_s <sachin.nand_at_nyahnyahspammersnyahnyah>
Date: Sun May 05 2013 - 22:54:44 MDT

Dear Recipient,

I'm trying to merge two XY into one frame but still its generating errors. I have projected separate graphs for TEMPERATURE versus Pressure and SALINITY versus PRESSURE but am still finding difficulties in merging the graphs. I have tried to merge the profiles using following code but it's still generating errors as given below this CODE:
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"
;************************************************
begin
;************************************************
; get list of files
;************************************************
diri = "pacific-12-2012/pacific/2012/12/" ; input directory
fili = systemfunc("cd "+diri+" ; ls nodc_R5901391*nc")
print(fili)
nfili = dimsizes(fili)

;************************************************
; plot resources
;************************************************
res = True ; plot mods desired
res@trYReverse = True ; reverse Y-axis
res@xyLineThicknessF = 2 ; choose dash patterns
res@gsnDraw = False
res@gsnFrame = False

resP = True
resP@gsnMaximize = True

plot = new (2, "graphic")
plot1 = new(nfili,"graphic")
plot2 = plot

do nf=0,nfili-1
      f = addfile (diri+fili(nf),"r")
      t = f->temperature(0,:,0,0)
      s = f->salinity(0,:,0,0)
      sfx = get_file_suffix(fili(nf),0)
      pname = sfx@fBase
      wks = gsn_open_wks ("ps",pname)
      res@xyLineColor = (/"blue"/)
      plot1(nf) = gsn_csm_xy (wks,t,t&pressure,res) ; create plot
      res@xyLineColor = (/"red"/)
      plot2(nf) = gsn_csm_xy (wks,s,s&pressure,res) ; create plot
      if (nf.ne.0) then
         overlay(plot1(0),plot1(nf))
         overlay(plot1(0),plot2(nf)) ................................................................................ERROR OCCURS NEAR OR IN THIS LINE.
      delete([/t,s/])
      end if
end do
resP@txString = fili(nf)
gsn_panel(wks,(/plot1(0),plot2(0)/),(/2,1/),resP)
end

Error is generated after compilation and execution as given below:

[cid:image001.png@01CE4A7A.4F8D2A00]

Can anyone assist me please as am the self-learner of NCL.....???

Thanks and best regards.

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

image001.png
Received on Sun May 5 22:55:00 2013

This archive was generated by hypermail 2.1.8 : Tue May 07 2013 - 08:38:33 MDT