diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-07 15:57:55 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-07 15:57:55 -0400 |
commit | eb0b2b4b8c2186f31483f85dfa1d76890b1d6534 (patch) | |
tree | 34ee06a81f80288058b0dbc5b64bec2320ad1e6f | |
parent | 09c4d6d512d3e23eb845e5fb5865db3f91edba67 (diff) | |
download | wgmr-eb0b2b4b8c2186f31483f85dfa1d76890b1d6534.tar.gz wgmr-eb0b2b4b8c2186f31483f85dfa1d76890b1d6534.zip |
plot images of the decaying beams
-rw-r--r-- | plot_beams_and_faces_figure.m | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/plot_beams_and_faces_figure.m b/plot_beams_and_faces_figure.m new file mode 100644 index 0000000..d8bb4d9 --- /dev/null +++ b/plot_beams_and_faces_figure.m @@ -0,0 +1,29 @@ +function plot_beams_and_faces_figure(border_limits, img, faces) + %% plot faces and beams images + % border_limits has coordinates of left bottom and right top coners + xlb=border_limits(1); + ylb=border_limits(2); + xrt=border_limits(3); + yrt=border_limits(4); + + [Ny,Nx]=size(img); + xc=linspace(xlb,xrt, Nx); + yc=linspace(ylb,yrt, Ny); + + %% dummy plot just to put axis in the proper directions + plot(xlb,ylb,'.', xrt,yrt, '.'); + %% plot ray images + imagesc(xc,yc, img); colorbar; + + %% plot all faces + Nf=size(faces)(2); % number of faces + for i=1:Nf + hold on; + t=linspace(0,1,100); + xf=faces{i}.vertex1(1) + (faces{i}.vertex2(1)-faces{i}.vertex1(1))*t; + yf=faces{i}.vertex1(2) + (faces{i}.vertex2(2)-faces{i}.vertex1(2))*t; + plot(xf,yf, 'k-'); + end + + +end |