attempt to change the axis of an axes limits remove the original image
조회 수: 5 (최근 30일)
이전 댓글 표시
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
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
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
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 Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!