setting WindowButtonMotionFcn to several subplots. Later command set(gcf, 'WindowButtonMotionFcn'...) work only for last suplot
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi
I have a figure with 2 subplot
f=figure
subplot(2,1,1)
plot(...)
% Then I set WindowButtonMotionFcn with my function highlightPlot_1
set(gcf, 'WindowButtonMotionFcn', @(src,event)highlightPlot_1(hittest(src)));
% if I make a breackpoint here, it works for 1st subplot
% Then I plotting another subplot
subplot(2,1,2)
plot(...)
%and again set WindowButtonMotionFcn with my another function highlightPlot_2
set(gcf, 'WindowButtonMotionFcn', @(src,event)highlightPlot_2(hittest(src)));
% at the end WindowButtonMotionFcn works only for 2nd subplot. It seems like 2nd set(gcf, ...) command overwrites previous one.
% And I understood that I cannot set WindowButtonMotionFcn for specific subplot?
So is it possible to have two working WindowButtonMotionFcn for each of subplot?
...You can say like separate subplots to two figures - prabably it will work but I want to have it in subplots.
Thanks!
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!