Can't create second axes in the place of first axes in GUI. is that a bug?

1 Ansicht (letzte 30 Tage)
Hi,
I try to draw two images one on another, like background image and foreground and then the foreground image make half a transparent. More than that I want to do two different colormaps in the pictures. However when I create second axes in the gui I dont see it's created, I see in the properties the right clim the right boundaries in X and Y but I dont see the image in GUI, just nothing happens.
I have two 40X40 matrices (handles.topography_trace,whole_matrix_sum).
clim_raman = [min(whole_matrix_sum(:)), max(whole_matrix_sum(:))];
clim_topography = [min(handles.topography_trace(:)), max(handles.topography_trace(:))];
cla(handles.axes1);%here I clean image if I have it from the previous itteration
axes(handles.axes1);%here I point on the axes I want to draw the picture
ax1=handles.axes1;% I call it ax1
hB = imagesc(whole_matrix_sum,clim_raman);%here I draw the picture in that axes
hold on;% keep that figure on
ax2=axes('Position',ax1.Position);%here I should create another axes on the same position as ax1. But I dont see it's creating!!!
hF = imagesc(handles.topography_trace,clim_topography);% here it should draw the picture in the ax2, but it doesnt draw!!!!!
linkaxes([ax1 ax2]); % here I link 2 axes.
colormap(ax1,'jet'); %raman % here it should create the picture in ax1 in jet colormap
colormap(ax2,'parula'); % here I do half a transparent the second foreground picture.
hB.AlphaData=double(whole_matrix_sum > 0);% here I make transparent all the points in the matrix which are zeros
hF.AlphaData=0.5;% here I do half a transparent the second foreground picture.
The problem I dont see the second axes is created in GUI. I dont see the second picture (hF) is creating. In properties I see the right clim for ax1 and for ax2, but I dont see that axes is creating!!!!
Actually I try to do it with just a picture outside the GUI and it works but in the case of GUI it doesnt work.
function link2axes(whole_matrix_sum,topography_trace)
figure;
ax1=axes;
raman=imagesc(whole_matrix_sum);
ax2=axes;
topography_image=imagesc(topography_trace);
linkaxes([ax1,ax2]);
ax2.Visible = 'off';
ax2.XTick = [];
ax2.YTick = [];
colormap(ax1,'jet'); %raman
colormap(ax2,'parula'); %topography
set(raman, 'AlphaData', double(whole_matrix_sum > 0));
set(topography_image, 'AlphaData', 0.6);
Please help me.
Thank you.

Antworten (0)

Produkte


Version

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by