Create Magnified Plot of Rectangular ROI on Same Figure
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
Citation pour cette source
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. Récupéré le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
magnifyPlot
Version | Publié le | Notes de version | |
---|---|---|---|
1.0.1 | Added example figure |
||
1.0.0 |