How to zoom in / out with a given coordinate of the image plotted in the figure
    14 views (last 30 days)
  
       Show older comments
    
    Hiroyasu Fujita
 on 2 Feb 2021
  
    
    
    
    
    Edited: Walter Roberson
      
      
 on 2 Feb 2021
            In the image plotted in the figure, select with the mouse to enlarge / reduce,
If anyone knows how to zoom in / out at any multiple around a given coordinate, would you please let me know?
I want to change the attached before image to a figure like the after image.
0 Comments
Accepted Answer
  Walter Roberson
      
      
 on 2 Feb 2021
        
      Edited: Walter Roberson
      
      
 on 2 Feb 2021
  
      zooming is handled by altering the xlim and ylim properties of the axes. So take the coordinate that you want to center, and subtract half the data width to display to get one edge and add half the data width to display to get the other edge, and xlim() and ylim() as appropriate. 
See also https://www.mathworks.com/help/matlab/ref/matlab.graphics.interaction.internal.zoom.html but that does not permit you to choose the point.
0 Comments
More Answers (0)
See Also
Categories
				Find more on Data Exploration in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
