diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-07 16:48:52 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-07 16:48:52 -0400 |
commit | 9e5a8cc303a448985d726c205fa9ec089a8b3319 (patch) | |
tree | 74773986b7c1cd3ac927f0483231b8404bfd4cca | |
parent | 1953d28f5250b08bbfa7d44c438421ca4faac269 (diff) | |
download | wgmr-9e5a8cc303a448985d726c205fa9ec089a8b3319.tar.gz wgmr-9e5a8cc303a448985d726c205fa9ec089a8b3319.zip |
proper colormap
-rw-r--r-- | plot_beams_and_faces_figure.m | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/plot_beams_and_faces_figure.m b/plot_beams_and_faces_figure.m index d8bb4d9..6aebd8c 100644 --- a/plot_beams_and_faces_figure.m +++ b/plot_beams_and_faces_figure.m @@ -1,4 +1,4 @@ -function plot_beams_and_faces_figure(border_limits, img, faces) +function plot_beams_and_faces_figure(border_limits, img, faces, fig_handle) %% plot faces and beams images % border_limits has coordinates of left bottom and right top coners xlb=border_limits(1); @@ -10,10 +10,31 @@ function plot_beams_and_faces_figure(border_limits, img, faces) xc=linspace(xlb,xrt, Nx); yc=linspace(ylb,yrt, Ny); + figure(fig_handle); %% dummy plot just to put axis in the proper directions plot(xlb,ylb,'.', xrt,yrt, '.'); + hold on; + + indx_ne_zero = (img != 0); + indx_eq_zero = (img == 0); + %% intensity to log scale + img( indx_ne_zero ) = log10( img(indx_ne_zero) ); + % make sure that the places with no beams get smallest image value + smallest_intensity = min(min(img(indx_ne_zero))); + largest_intensity = max(max(img(indx_ne_zero))); + img( indx_eq_zero ) = smallest_intensity-(largest_intensity-smallest_intensity)*.4; + + %% colormap + Ncolors=64; + R=linspace(0.3,1.0, Ncolors); + G=R*0; + B=R*0; + % no beams will be white + R(1)=1; G(1)=1; B(1)=1; + colormap([R',G',B']); %% plot ray images imagesc(xc,yc, img); colorbar; + hold on; %% plot all faces Nf=size(faces)(2); % number of faces @@ -24,6 +45,7 @@ function plot_beams_and_faces_figure(border_limits, img, faces) yf=faces{i}.vertex1(2) + (faces{i}.vertex2(2)-faces{i}.vertex1(2))*t; plot(xf,yf, 'k-'); end + hold off; end |