MATLAB: Keep the graphic’s zoom graphicsguihandle graphicszoom Hi, I would like to know how I can keep the zoom of graphic when I will go to change the variable that I'm watching at the moment. thanks regards Best Answer Another approach:y1 = rand(1, 100);y2 = rand(1, 200) * 2;AxesH = axes('NextPlot', 'add');Plot1H = plot(y1);pause(2.0);set(AxesH, 'XLimMode', 'manual', 'YLimMode', 'manual');Plot2H = plot(y2, 'r');Or you can replace the XData and YData of the plotted line directly instead of the last line:set(Plot1H, 'XData', 1:200, 'YData', rand(1, 200)); Related SolutionsMATLAB: Apply Zoom in other axes See the help for LINKAXES.Cheers, Brett MATLAB: Return to previous zoom level/location Here is an example.load clownimage(X)% Now zoom in on the eye.% After zooming in, do this:..L = get(gca,{'xlim','ylim'}); % Get axes limits.X = ind2rgb(X,map);image(X)zoom resetset(gca,{'xlim','ylim'},L)% Now the plot should be zoomed in around the eye again, but you can also zoom out. Related QuestionDetermine axis limits *before* plotting..Please help me about guideSetting plot zoom mode
Best Answer