scaleline¶
- scaleline(varargin)
SCALELINE Add a zoom-aware scale bar to the x or y axis of a figure
- Usage:
[h_scaleline, h_scalelabel] = scaleline(ax, time) [h_scaleline, h_scalelabel] = scaleline(ax, time, label) [h_scaleline, h_scalelabel] = scaleline(ax, time, label, line_axis) [h_scaleline, h_scalelabel] = scaleline(ax, time, label, line_axis, gap)
- Inputs:
ax : axes handle - target axes (default: gca) time : double - scale line length in plot units label : char - label text for the scale line (default: blank) line_axis : char - axis to which the line is attached, ‘x’ or ‘y’ (default: ‘x’) gap : double - gap between line and axis in normalized units (default: 0.01)
- Outputs:
h_scaleline : handle - handle to the scale line h_scalelabel : handle - handle to the scale label
Example
figure; plot(randn(1,10000)*10000); axis tight; xlabel(‘Time (s)’); ylabel(‘Voltage (V)’); scaleline(gca, 1000, ‘1000 seconds’); scaleline(gca, 5000, ‘5000 V’, ‘y’);
See also: zoom, linkaxes
∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿