shadebounds

shadebounds(x, mid, hi, lo, mid_color, shade_color, bounds_color, shade_alpha)

SHADEBOUNDS Plot a curve with shaded upper/lower bounds on a 2-D axis

Usage:

[line_handle, bounds_handle] = shadebounds(x, mid, hi, lo) [line_handle, bounds_handle] = shadebounds(x, mid, hi, lo, mid_color, shade_color, bounds_color, shade_alpha)

Inputs:

x : 1xN double - independent variable – required mid : 1xN double - central curve – required hi : 1xN double - upper bound of the shaded region – required lo : 1xN double - lower bound of the shaded region – required mid_color : color spec - color of the central curve (default: [0 0 0]) shade_color : color spec - color of the shaded region (default: [.2 .2 .2]) bounds_color : color spec - color of the shaded region edges (default: [.9 .9 .9]) shade_alpha : double - fill transparency (default: 0.1)

Outputs:

line_handle : handle - handle to the central curve bounds_handle : handle - handle to the fill object

Example

x = 1:10; mid = x.^2; hi = mid + 6; lo = mid - 4; shadebounds(x, mid, hi, lo); shadebounds(x, mid, hi, lo, ‘red’, [1 0.8 0.8], ‘black’, 0.3);

See also: fill, plot

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