Dear all:
I'm trying to add some error_bar to my plot. For efficiency, I use a function to do this.
But the plot is generated without error bar, and it throws:
warning:TransformPostDraw: tfPolyDrawList element 0 is invalid
warning:TransformPostDraw: tfPolyDrawList element 1 is invalid
.....
plot(0) = add_error_bar(wks,res,6,mid,std)
.....
undef("add_error_bar")
function add_error_bar(wks,res,nps:numeric,mean:numeric,std:numeric)
begin
plot = gsn_csm_xy(wks,ispan(1,6,1),mean(0:5),res)
polyres = True
polyres@gsMarkerIndex = 1 ; index for circle
polyres@gsMarkerSizeF = .01 ; size
error_bar = new(nps,graphic)
centers = new(nps,graphic)
do t = 0, dimsizes(nps)-1
centers(t) = gsn_add_polymarker(wks,plot,t+1,mean(t),polyres)
error_bar(t) = gsn_add_polyline(wks,plot,(/t+1,t+1/),(/mean(t)-std(t),mean(t)+std(t)/),polyres)
end do
return(plot)
end
Thanks
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Apr 1 07:58:26 2012
This archive was generated by hypermail 2.1.8 : Mon Apr 09 2012 - 13:43:03 MDT