フィルターのクリア

attempt to change the axis of an axes limits remove the original image

2 ビュー (過去 30 日間)
daniel
daniel 2014 年 5 月 11 日
コメント済み: Image Analyst 2014 年 5 月 12 日
Hello, I created GUI with several axis and pushing buttons. I loaded binary image to specific axes (let call it axes1). now i would like to change the image axis so it will be tight on the image and than plot on the image afterwards.
now i've been noticed that if i tried to change the image axis the image remove (the axes area turns gray). this is my code:
axes(handles.axes1)
imageAxes1 = imshow(temp_struct.binary_image);
axis([xmin xmax ymin ymax]);
hold on
and from some reason it doesn't work. there are any specific rule for changing axis in GUI? by the way i am using the guide for building the gui.
Thanks.
  1 件のコメント
dpb
dpb 2014 年 5 月 11 日
編集済み: dpb 2014 年 5 月 11 日
I don't have the toolbox so I don't know just what the image object is, precisely, but I wonder if by first creating an axes object then the image object you don't have dueling axes wherein you've changed the limits on the current handle graphics object which is axes1 rather than for the image object axes. The grayout to me implies this that you've made that background axes now the foreground so it's masking the image.
Again, I don't have the Toolbox so can't test, but I'd suggest you dispense with the call to axes and use imshow and it's handle and properties exclusively.
IA has been around this AM, he's the expert; maybe he'll notice this and have the definitive answer altho I suspect it's at least related to the above altho that may not be the optimum solution. (Besides not having the toolbox, I don't do GUIs.)

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

採用された回答

Image Analyst
Image Analyst 2014 年 5 月 11 日
編集済み: Image Analyst 2014 年 5 月 12 日
I'd just do this:
axes(handles.axes1)
imshow(temp_struct.binary_image);
axis on; % Or off.
hold on
You can set axis limits with xlim() and ylim() though I don't know why you'd do that, and I'm not sure you can, if you've displayed an image first.
  2 件のコメント
daniel
daniel 2014 年 5 月 12 日
Great! i dont know why but the line:
axis on;
fix the issue Thanks again!
Image Analyst
Image Analyst 2014 年 5 月 12 日
Not sure either, but it's what I always do. I never do what you did first, though it may be allowed, so I'm not familiar with when that way of calling it should be used. Glad it worked though.

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

その他の回答 (0 件)

カテゴリ

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