I plot two subplots in my figure. After changing the data of the plots, the behavior of a 'doubleclick' in zoom mode doesn't work well anymore. It fits the axes limits to the OLD data instead of the new data. This problem appears only when the axes are linked.
x1 = 0:5;y = rand(size(x1));y2 = rand(size(x1));ax1 = subplot(2,1,1)myPlt1 = plot(x1, y);ax2 = subplot(2,1,2)myPlt2 = plot(x1, y2);linkaxes([ax1 ax2], 'x');waitfor(warndlg('Now zoom a bit in one of the two axes'))x2 = x1/2;myPlt1.XData = x2myPlt2.XData = x2warndlg('doubleclick on axes will cause x axes zoom to 0-5 instead of 0-2.5')
Best Answer