How can I add a error bar through my procedure?

Hi,

I have a procedure about how to get a scatter figure as attached picutre. Now I want to add error bar of x and y axis in attached picutre (just add the error bar to the red marker), how can I do through the procedure? Thank you very much.


Function bin_bc_scattering()
wave bc_scatter, bc_mass, bc_core_ssize
variable/G ASSUMED_COAT_INDEX
make/o/n=21 mass = p+2
mass[15,20] = 17 + 5*(p-15)^2
make/o/n= 20 test_dry_mass, test_dry_core_ssize= nan, test_dry_mie, test_dry_scat,test_dry_scat_mode, test_dry_thick =nan
make/o/n=20 test_dry_avg
variable n = 0
do
range_select(bc_mass, bc_mass,mass[n], mass[n+1], "tt")
wave tt
wavestats/q tt
test_dry_mass[n] = v_avg
duplicate/o tt tved
tved = (tt*6/pi/1.8/1000)^(1/3)
range_select(bc_core_ssize, bc_mass,mass[n], mass[n+1],"tt")
wavestats/q tt
test_dry_core_ssize[n] = log(v_avg)
range_select(bc_scatter, bc_mass,mass[n], mass[n+1],"tscat")
wave tscat
histogram/b={100,100,100} tscat, hi
CurveFit/q/M=2/W=0 gauss, hi
wave w_coef
test_dry_scat_mode[n] = log(w_coef[2])
wavestats/q tscat
test_dry_scat[n] = log(v_avg)

test_dry_mie[n] = log(interp((test_dry_mass[n]*6/pi/1.8/1000)^(1/3),coreli_diams,bare_r249i149_signal))
tscat = lookup_col_val_from_vol_alaMG(r249i149_signal_volume,diams_large_volume,coatings_large_volume,coreli_index_values, tved,tscat,ASSUMED_COAT_INDEX*100,200,"bare_r249i149_signal")
wavestats/q tscat
test_dry_thick[n] = v_avg



n+=1
while(n<20)


display test_dry_mie vs test_dry_mass
appendtograph test_dry_scat vs test_dry_mass
ModifyGraph rgb(test_wet_mie)=(0,0,0),rgb(test_wet_scat)=(1,16019,65535)
end
Something like
ErrorBars test_wet_scat, Y wave=(errorWave, errorWave)
That makes a symmetric error bar (it uses the same wave for the positive and negative error bars) and it assumes you want to use waves for the error bars. Check the documentation for more options.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com