필터 지우기
필터 지우기

Subplots in an "axes" object

조회 수: 69 (최근 30일)
K BV
K BV 2012년 6월 27일
Hi,
I would like to sublot four images (X(:,:,1) -> X(:,:,4)) in an "axes" object (axes1) but every time I have one image displayed and not the totality of the images.
Here is the part of my code which nomally should do that :
if(1<=nb_coupes)
axes(handles.axes1)
subplot(121)
imagesc(X(:,:,1)), colormap gray, axis('image'),axis('off'),colormap gray,zoom(2);
setappdata (Feature_Tracking,'images',X);
end
if(2<=nb_coupes)
hold on
subplot(122)
imagesc(X(:,:,2)), colormap gray, axis('image'),axis('off'),colormap gray,zoom(2);
setappdata (Feature_Tracking,'images',X);
end
if(3<=nb_coupes)
hold on
subplot(211)
imagesc(X(:,:,3)), colormap gray, axis('image'),axis('off'),colormap gray,zoom(2);
setappdata (Feature_Tracking,'images',X);
end
set(handles.axes1,'String',FileName)
axes(handles.axes1)
imagesc(X(:,:,1)), colormap gray, axis off, axis image
setappdata (Feature_Tracking,'images',X);
Would you please help me solving the problem ?
Thank you in advance !

채택된 답변

Walter Roberson
Walter Roberson 2012년 6월 27일
You cannot do this. subplot() creates new axes for the plots, and cannot plot inside an axes.
See also this part of the subplot documentation:
If a subplot specification causes a new axis to overlap a existing axis, the existing axis is deleted - unless the position of the new and existing axis are identical. For example, the statement subplot(1,2,1) deletes all existing axes overlapping the left side of the figure window and creates a new axis on that side—unless there is an axes there with a position that exactly matches the position of the new axes (and 'replace' was not specified), in which case all other overlapping axes will be deleted and the matching axes will become the current axes.
  댓글 수: 1
K BV
K BV 2012년 7월 2일
Thanks for the answer WR.
I could display my images as I wished.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by