In a figure window toolbar, there are spyglass icons that let you zoom in and out on parts of an image or plot. I'd like to know how to do this programmatically.
No products are associated with this question.
There is a function "zoom" with the following options :
zoom on zoom off zoom out zoom reset zoom xon zoom yon zoom(factor) zoom(fig, option) h = zoom(figure_handle)
If you know the zoom level that you want, you can do it by setting the Xlim and Ylim on the Children of the figure handle. So if you wanted to zoom the x axis between 400 and 500 you could do: h=gcf; set(h.Children,'Xlim',[400 500]);
Play games and win prizes!Learn more