Matlab单击缩放禁用第二次循环

时间:2016-05-24 15:32:35

标签: matlab plot matlab-figure

考虑以下示例

ax(1) = subplot(2,1,1)
plot(1:100,rand(1,100))
ax(2) = subplot(2,1,2)
plot(1:100,rand(1,100))
hzoom(1) = zoom(ax(1));                                               
hzoom(1).Motion = 'horizontal'; 
hzoom(2) = zoom(ax(2));                                               
hzoom(2).Motion = 'horizontal'; 
zoom on 
linkaxes(ax, 'x'); 
waitforbuttonpress;
while 1
    [x,  ~] = ginput(2); 
    zoom on
    waitforbuttonpress;
    click_break = waitforbuttonpress;
    if(click_break)
        break;
    end
end

在第一次循环的上图中,鼠标光标是放大镜,只需选择它即可放大数据 enter image description here 在这里我们可以看到数据放大了

enter image description here

但是当我点击两次(对于ginput获取数据点)并且循环在下一次迭代中运行时,光标不会通过选择特定数据来放大/缩放,我知道我们也可以通过滚动放大但我的滚动有开发出一些问题,放大倍数收敛到中心数据点,所以唯一的可能性就是通过鼠标点击选择数据,我是否错过了循环中的任何功能?

0 个答案:

没有答案