How to zoom in to a particular point of an image?

75 views (last 30 days)
Hi,
I'm trying to zoom in to a particular point of an image and not the full image.
In the above figure, I want to zoom in to the point n=4.9 only.
Kindly let me know as how it is to be done.
with regards,
rc
  2 Comments
Shubham
Shubham on 8 Sep 2023
Refer to this MATLAB Answer and see if it works out for you
Add your image path zoom_image.m file and then adjust the position and change the zoom percentage.
Rahul
Rahul on 8 Sep 2023
Hi,
Thanks for your advice.
But the code as above in the shared link doesn't detect a matlab (.m) file. It can detect jpg file.
Actually, I want something like this as below where the magnified image is superimposed with the original
for my profile which I want to zoom in at n=4.9 and superimpose with my original profile.
Not sure if the shared code can do this.
with rgds,
rc

Sign in to comment.

Accepted Answer

Dyuman Joshi
Dyuman Joshi on 8 Sep 2023

More Answers (1)

Image Analyst
Image Analyst on 8 Sep 2023
Try changing the axis limit by calling xlim and ylim to be the ranges you want.
help xlim
XLIM Set or query x-axis limits XLIM(limits) specifies the x-axis limits for the current axes. Specify limits as a two-element vector of the form [xmin xmax], where xmax is a numeric value greater than xmin. xl = XLIM returns a two-element vector containing the x-axis limits for the current axes. XLIM(limitmethod) specifies the method used to determine the x-limits for the current axes. Specify the limitmethod as 'tickaligned', 'tight', or 'padded'. This command sets the XLimitMethod property on the axes. m = XLIM('method') returns the current method for setting the x-axis limits, which can be 'tickaligned', 'tight', or 'padded'. By default, the method is 'tickaligned'. XLIM(limitmode) specifies automatic or manual x-limits selection. Specify the limitmode as either 'auto' or 'manual'. This command sets the XLimMode property on the axes. m = XLIM('mode') returns the current value of the x-axis limits mode, which is either 'auto' or 'manual'. By default, the mode is automatic unless you specify limits or set the mode to manual. ___ = XLIM(ax, ___ ) uses the axes specified by ax instead of the current axes. XLIM sets or gets the XLim, XLimMode, or XLimitMethod property of an axes. See also PBASPECT, DASPECT, YLIM, ZLIM, THETALIM, RLIM. Documentation for xlim doc xlim

Categories

Find more on Data Exploration in Help Center and File Exchange

Tags

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!