Interactive zoom plot

版本 1.1.0 (3.0 KB) 作者: praveen iv
Interactively draw the zoom area and axes for zoomed axes inlays. Check out the examples in the function to get started.
593.0 次下载
更新时间 2021/2/17

查看许可证

% Interactive Zoom plot
% [p_ax,ch_ax]= ZoomPlot()
% [p_ax,ch_ax]= ZoomPlot(p_ax)
%
% This function allow you draw zoomed/magnified axes on a existing axes.
% The funciton gets its axes handle from gca() when called with no input
% arguments. This function should work for all 2D linear axes plots like
% plot(), scatter(), quiver().
%
% INPUTS:
% p_ax - parent axes handle
%
%OUTPUTS:
% p_ax: handle of the parent axes
% ch_ax: handle of the child/Zoom axes
%
% Example 1: simple
% x = linspace(0,3*pi,200);
% y = [cos(x) + rand(1,200);cos(x+1) + rand(1,200)];
% figure,plot(x,y),title('Noisy cosines'),xlabel('x'),ylabel(y)
% ZoomPlot();
% %Follow the instructions on the title of the plot
%
% Example 2: create multiple zoomed axes and playing with handles
% x = linspace(0,3*pi,200);
% y = [cos(x) + rand(1,200);cos(x+1) + rand(1,200)];
% figure,plot(x,y),title('Noisy cosines'),xlabel('x'),ylabel(y)
% p_ax=gca;
% [p_ax,ch_ax1]=ZoomPlot(p_ax);
% %follow the instruction on the title of the plot
% [p_ax,ch_ax2]=ZoomPlot(p_ax);
% % set title and other properties with handle
% legend(p_ax,{'Cos','Shifted cos'})
% title(ch_ax1,'1st zoom plot')
% set(ch_ax1,'LineWidth',1.5,'XColor',lines(1),'YColor',lines(1))
% title(ch_ax2,'2nd zoom plot')

Similar plotting function:
https://in.mathworks.com/matlabcentral/fileexchange/59857-zoomplot

Known Issues:
v1.1.0: Size of zoom axes is scaled down during interaction for moving and resizing zoom axes ROI

引用格式

praveen iv (2024). Interactive zoom plot (https://www.mathworks.com/matlabcentral/fileexchange/86358-interactive-zoom-plot), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2019a
与 R2018b 及更高版本兼容
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0

* Can work on existing axes.
* works for all linear 2D axes now like plot(),scatter(),etc
* Preserve parent axes title and legends

1.0.0