inset2DAbsolute

inse2DAbsolute creates an axes inset, defined using the larger axes, and corresponding annotations

You are now following this Submission

[ insetAxesHandle rectHandle rectHandleInset annHandles] = inset2DAbsolute(axesHandle, insetLoc, style, rectLoc, varargin)

inset2DAbsolute creates a new axes located within the specified axes (identified by axesHandle) along with corresponding rectangle/lines/arrows as indicated by style. The axes location is defined using coordinates within axesHandle, rather than percentages of the figure.

If 'ZOOMN' or 'ARROW' are selected for the style variable, rectangles are added to both the inset and parent axes to identify the data and the inset is automatically populated with the appropriate data. If only an inset is desired, simply leave style undefined or set to [].

Handles are returned so that the insets, rectangles, and annotations (lines/arrows) can be customized.

Example:

% Generate and Plot Data
x = -10:.1:10;
y = sinc(x);
figure;plot(x,y);

% Define input arguments and create inset
insetLoc = [2 8;.4 .8];
style = 'ARROW';
rectLoc = [6 8;-.1 .1];
inset2DAbsolute(gca,insetLoc,style,rectLoc,'Color',[0 0 0],'LineWidth',2);

CAVEAT: Although the inset data is correctly mapped and appears to be correctly color-coded, the "RGB" values that are obtained from a data cursor are incorrect.

Cite As

James Hall (2026). inset2DAbsolute (https://www.mathworks.com/matlabcentral/fileexchange/33159-inset2dabsolute), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0