hello--
I'm trying to plot two cumulative distribution functions for two
different data sets in one plot using cdfnor_p. However, if I try to
plot this as two single functions, I get a complicated array of lines.
Any suggestions? Am I misusing this function?
Thanks-
Allison
;***********************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;************************************************
begin
;************************************************
; read in 2D data
;************************************************
irr25 = addfile("r25irr.nc","r")
irr39 = addfile ("../cctm_RUN39/run39irr.nc","r")
avoc1 = irr25->lAVOCnet
avoc2 = irr39->lAVOCnet
;************************************************
; make data 1d
;************************************************
avoc11d = (ndtooned(avoc1))*1000.
avoc21d = (ndtooned(avoc2))*1000.
cdf1 = new(dimsizes(avoc11d),float)
mean1 = new(dimsizes(avoc11d),float)
sd1 = new(dimsizes(avoc11d),float)
mean1 = dim_avg(avoc11d)
sd1 = dim_stddev(avoc21d)
cdf1 = cdfnor_p(avoc11d,mean1,sd1)
cdf2 = new(dimsizes(avoc11d),float)
mean2 = new(dimsizes(avoc11d),float)
sd2 = new(dimsizes(avoc11d),float)
mean2 = dim_avg(avoc21d)
sd2 = dim_stddev(avoc21d)
cdf2 = cdfnor_p(avoc21d,mean2,sd2)
;************************************************
; define output arrays
;************************************************
avocout = new((/2,dimsizes(cdf1)/),float)
avocout(0,:) = cdf1(:)
avocout(1,:) = cdf2(:)
;************************************************
; plotting parameters
;************************************************
wks = gsn_open_wks ("x11","fig9")
res = True ; plot mods desired
res_at_xyLineColors = (/"blue","green"/) ; line color
plot = gsn_csm_xy(wks,avoc11d,avocout,res)
end
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 08 2006 - 15:43:24 MDT
This archive was generated by hypermail 2.2.0 : Thu Aug 10 2006 - 15:20:04 MDT