How to plot the contourf result inside an specific axes on GUI?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello guys. I am having a problem when I try to load a picture, apply the Contourf function and plot in the correct axes. Every time I load the picture, the Contourf result takes place on the last axes on my GUI. Without using the GUI it works perfectly using a new figure. I will show the code without GUI and with GUI. Thank you so much.
--------------- BUTTON CODE -------------- [path, user_cance] = imgetfile();
if user_cance msgbox(sprintf('Please, select image!'), 'Error', 'Error'); return end
index = imread(path); index = imresize(index, 0.05); index_gray = rgb2gray (index);
index_rot = imrotate(index_gray, 90); index_ref = contourf(index_rot);
axes(handles.ax_index_ref); imshow(index_ref); ----------- END BUTTON CODE ----------
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197323/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197325/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197328/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197330/image.jpeg)
댓글 수: 0
답변 (1개)
Walter Roberson
2018년 10월 8일
Pass the axes handle as the first parameter to contourf.
Note: doing so will not change which axes is the active axes, which could be just about any axes. I recommend that you search on tag:always-parent
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!