With the same data plotted in two sets of axes, cropbox.m draws a box in the first axes to indicate the cropping limits specified by the user. The second axes is cropped to the specified limits and lines are drawn linking the corners of the cropping box to the corners of the cropped axes.
Lines are broken into multiple line segments at the points where they intersect with any axes bounding boxes in the figure. This allows the user to customise the line properties, making them invisible where they pass in front of a ylabel, for instance, or making them white where they pass in front of a dark image.
Kevin Bartlett (2024). Annotated cropping of data plots (https://www.mathworks.com/matlabcentral/fileexchange/34450-annotated-cropping-of-data-plots), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!