how to delete an object in a plot using the delete button in keyboard
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi all,
I want to delete an object I created in a plot using the delete button. I created a GUI with a plot plotting a figure as described by the following:
t = 0:pi/5:2*pi;
figure
patch(sin(t),cos(t),'y')
axis equal
Now how should I delete it using the delete button?
Thanks
Viv
댓글 수: 2
Mahdi
2013년 3월 26일
What do you want to delete? Do you want to delete the whole plot? Close the figure?
Why do you want to use the delete button? Why not close, or alt+F4?
채택된 답변
Walter Roberson
2013년 3월 26일
Use the figure KeyPressFcn or WindowKeyPressFcn callback. Test the received key. If it is the delete character, then delete() the object handle.
댓글 수: 8
추가 답변 (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!