Create Magnified Plot of Rectangular ROI on Same Figure

版本 1.0.1 (57.1 KB) 作者: Rishabh Datta
This function magnifies a specified rectangular area in the current figure, and plots the magnified area on the same figure.
286.0 次下载
更新时间 2021/2/12

查看许可证

This function magnifies a specified rectangular area [xlm, ylm]
in the current figure,and plots the magnified area on the same figure at axis defined by
position pos

Inputs:
xlm = 1x2 vector specifying limits of x-axis
ylm = 1x2 vector specifying limits of y-axis
pos = 4x1 vector specifying position of new axis
lwid = linewidth of lines in magnified plot
showAxisLabels = boolean to turn axis labels on/off

Example usage:
x = 0:10; y1 = x; y2 = 3 - 0.5*x;
figure;
plot(0:10,y1,'k--','linewidth',2); hold on;
plot(0:10,y2,'ko-','linewidth',2); hold on;
axis square;
xlm = [1.5,2.5];
ylm = [1.5,2.5];
pos = [.25 .6 .25 .25]; % pos = [x0, y0, xwidth, ywidth]

magnifyPlot(xlm,ylm,pos,2,false) % call function

(c) Rishabh Datta, 2021-02-12

引用格式

Rishabh Datta (2024). Create Magnified Plot of Rectangular ROI on Same Figure (https://www.mathworks.com/matlabcentral/fileexchange/87332-create-magnified-plot-of-rectangular-roi-on-same-figure), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2020b
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!

magnifyPlot

版本 已发布 发行说明
1.0.1

Added example figure

1.0.0