specbar
The specbar function adds a spectral colorbar to a figure.
Usage:
specbar(ticks,h)
Where:
| Parameter | Description |
ticks(optional) | Defines the x-axis tick labels. |
h(optional) | Specifies the axis handle, default: current active axis (gca). |
Plot Standard Illuminants D50, D65 and D75:
lam = 380:780;
spec = ciespec(lam,{'D50','D65','D75'});
plot(lam,spec)
xlim([lam(1) lam(end)])
xlabel('\lambda in nm')
legend('D50','D65','D75')
grid on
specbar
see also: ciespec
Result:

Plot Standard Illuminants D50, D65 and D75 and define x-ticks:
lam = 380:780;
spec = ciespec(lam,{'D50','D65','D75'});
plot(lam,spec)
xlim([lam(1) lam(end)])
xlabel('\lambda in nm')
legend('D50','D65','D75')
grid on
specbar(380:50:780)
see also: ciespec
Result:
