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!