diff --git a/docs/src/tut1.md b/docs/src/tut1.md index 83824c3..ee0ae38 100644 --- a/docs/src/tut1.md +++ b/docs/src/tut1.md @@ -29,16 +29,15 @@ depending on `bfrac`. Their amplitudes are determined by `afrac`. gobs=zeros(ntg,nr) # allocate FBD.toy_direct_green!(gobs, c=4.0, bfrac=0.20, afrac=1.0); # add arrival 1 FBD.toy_reflec_green!(gobs, c=1.5, bfrac=0.35, afrac=-0.6); # add arrival 2 -#plotg=(x;args...)->heatmap(x, size=(250,500), yflip=true, ylabel="time", xlabel="channel";args...) # define a plot recipe -#p1=plotg(gobs, title="True g") +plotg=(x,args...)->spy(x, Guide.xlabel("channel"), Guide.ylabel("time"),args...) # define a plot recipe +p1=plotg(gobs, Guide.title("True g")) ``` The source signature `s` for the experiment is arbitrary: we simply use a Gaussian random signal. ```@example tut1 sobs=randn(nts) -#plot(sobs, label="arbitrary source", size=(1000,200)) -plot(x=1:10, y=randn(10)) +plot(y=sobs,x=1:nts,Geom.line, Guide.title("arbitrary source"), Guide.xlabel("time")) ``` The next task is to generate synthetic observed records `dobs`: @@ -66,7 +65,7 @@ FBD.lsbd!(pa) We extract `g` from `pa` and plot to notice that it doesn't match `gobs`. ```@example tut1 -#p2=plotg(pa[:g], title="LSBD g") +p2=plotg(pa[:g], Guide.title("LSBD g")) ``` Instead, we perform FBD that uses the focusing functionals to regularize `lsbd!`. @@ -78,7 +77,6 @@ FBD.fbd!(pa) Notice that the extract impulse responses are closer to `gobs`, except for a scaling factor and an overall translation in time. ```@example tut1 -#p3=plotg(pa[:g], title="FBD g") -#plot(p1,p2,p3, size=(750,500), layout=(1,3)) +p3=plotg(pa[:g], Guide.title("FBD g")) ``` diff --git a/test/tut1.jl b/test/tut1.jl index a5109ce..bb150a8 100644 --- a/test/tut1.jl +++ b/test/tut1.jl @@ -18,13 +18,12 @@ nts=nt # samples in `s` gobs=zeros(ntg,nr) # allocate FBD.toy_direct_green!(gobs, c=4.0, bfrac=0.20, afrac=1.0); # add arrival 1 FBD.toy_reflec_green!(gobs, c=1.5, bfrac=0.35, afrac=-0.6); # add arrival 2 -#plotg=(x;args...)->heatmap(x, size=(250,500), yflip=true, ylabel="time", xlabel="channel";args...) # define a plot recipe -#p1=plotg(gobs, title="True g") +plotg=(x,args...)->spy(x, Guide.xlabel("channel"), Guide.ylabel("time"),args...) # define a plot recipe +p1=plotg(gobs, Guide.title("True g")) # The source signature `s` for the experiment is arbitrary: we simply use a Gaussian random signal. sobs=randn(nts) -#plot(sobs, label="arbitrary source", size=(1000,200)) -plot(x=1:10, y=randn(10)) +plot(y=sobs,x=1:nts,Geom.line, Guide.title("arbitrary source"), Guide.xlabel("time")) # The next task is to generate synthetic observed records `dobs`: # first lets construct a linear operator `S`; then applying `S` on `g` will result in measurements `d`. @@ -43,14 +42,13 @@ FBD.lsbd!(pa) #+ # We extract `g` from `pa` and plot to notice that it doesn't match `gobs`. -#p2=plotg(pa[:g], title="LSBD g") +p2=plotg(pa[:g], Guide.title("LSBD g")) # Instead, we perform FBD that uses the focusing functionals to regularize `lsbd!`. FBD.fbd!(pa) #+ # Notice that the extract impulse responses are closer to `gobs`, except for a scaling factor and an overall translation in time. -#p3=plotg(pa[:g], title="FBD g") -#plot(p1,p2,p3, size=(750,500), layout=(1,3)) +p3=plotg(pa[:g], Guide.title("FBD g"))