Borrar filtros
Borrar filtros

Subplots in an "axes" object

69 visualizaciones (últimos 30 días)
K BV
K BV el 27 de Jun. de 2012
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 !

Respuesta aceptada

Walter Roberson
Walter Roberson el 27 de Jun. de 2012
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 comentario
K BV
K BV el 2 de Jul. de 2012
Thanks for the answer WR.
I could display my images as I wished.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by