zoom_fill

zoom_fill(ax_top, ax_bottom, top_range, bottom_range, varargin)

ZOOM_FILL Draw a connecting zoom polygon between two axes

Usage:

[h, fill_ax] = zoom_fill(ax_top, ax_bottom, top_range, bottom_range, …)

Inputs:

ax_top : axes handle - top axes – required ax_bottom : axes handle - bottom axes – required top_range : 1x2 double - x-range on top axes (default: ax_top.XLim) bottom_range : 1x2 double - x-range on bottom axes (default: ax_bottom.XLim)

Name-Value Pairs:

Any name-value pair accepted by the fill object is forwarded via SET.

Outputs:

h : handle to the fill object fill_ax : handle to the overlay axes

Notes

The two axes do not need to share a horizontal position or width: ranges are mapped through figure-normalized coordinates, so the polygon edges land on the correct data positions of each axes wherever it sits in the figure.

The polygon auto-updates when either source axes’ XLim changes (scroll, zoom, pan, programmatic); axes positions are re-read on each update. Call zoom_fill after the layout is final, though, so the overlay axes itself spans the right region of the figure.

Example

ax_top = subplot(211); ax_bottom = subplot(212); imagesc(ax_top, linspace(50,100), linspace(0,100), peaks(500)); imagesc(ax_bottom, linspace(3000,4100),linspace(-53,84), membrane(10,499)); [h, fill_ax] = zoom_fill(ax_top, ax_bottom, [75 85], [], …

‘FaceColor’,’cyan’,’EdgeColor’,’blue’);

See also: fill, axes, addlistener

∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿