How to close a UIAxes window?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello.
When I create a UIAxes object, I have no ability to close the window, other than manually. The 'close' command doesn't work. I've tried setting the visibility to 'off', of the UXAxes object, and that doesn't do anything either.
I'm using the UIAxes to get around UIFigure not having an ability to print the plot.
ux = uiaxes;
p = plot(ux,app.ECGPlot);
fig1 = figure;
ax = axes;
copyobj(ux.Children,ax);
savefig( fig1,'ECG');
close(fig1,ux);
Does a command for closing the window exist?
Thanks.
댓글 수: 0
답변 (1개)
Wilson A N
2017년 5월 9일
As I understand you are not able to close the 'fig1' and 'ux' windows.
In order to close the 'fig1' window, you can just use the close command as shown below:
>>close(fig1)
Now to close the 'ux' window you would need to get its corresponding figure handle and then use close command on it.('ux' is now specifying axes handle)
As 'ux' is created using uiaxes, the figure handle is hidden. Now inorder to get the figure handle and close the 'ux' window follow either one of the steps given below:
1. Get the figure handle using the following command:
>> uf = ux.Parent;
Then use the close command as shown:
>> close(uf)
2. After closing 'fig1', get the figure handle of 'ux' window using the findall command as shown:
>> uf = findall(0,'Type','figure');
Now use the close command to close the 'ux' window
>> close(uf)
You can find more information on the findall command in the following link:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!