Independent images on different axes in gui?

1 回表示 (過去 30 日間)
mostafa
mostafa 2012 年 5 月 20 日
コメント済み: Farjana Yeasmin 2014 年 12 月 13 日
I want show in the gui independent images on different axes , My program has two push button The push button must display an image independent axes or axes 1 and axes2 But output from running the program shows all images in axes1 and not showen any picture in axes 2
the part of program :
function pushbutton1_callback (...)
(handles.axes1) = imshow('c:\1.jpg')
function pushbutton2_callback(...)
(handles.axes2)= imshow('c:\2.jpg)

回答 (2 件)

Image Analyst
Image Analyst 2012 年 5 月 20 日
Nope. imshow returns the handle to the image object where you stuffed the image, in other words, it will return the handle of the image object living in the current axes called "gca." If you want to specify what axes to stuff your image into, then you can specify that with the 'Parent' option, or with the axes function.
% Method 1:
imshow(image1Array, 'Parent', handles.axes1);
imshow(image2Array, 'Parent', handles.axes2);
% Method 2:
axes(handles.axes1); % Make axes1 the gca.
imshow(image1Array);
axes(handles.axes2); % Make axes2 the gca.
imshow(image2Array);
  1 件のコメント
mostafa
mostafa 2012 年 5 月 21 日
thanks a lot

サインインしてコメントする。


joni hidayat
joni hidayat 2012 年 5 月 22 日
Thanks.. its very usefull

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by