frudawski

specbar

The specbar function adds a spectral colorbar to a figure.

Usage:

specbar(ticks,h)

Where:

ParameterDescription
ticks
(optional)
Defines the x-axis tick labels.
h
(optional)
Specifies the axis handle, default: current active axis (gca).
Examples

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:

Leave a comment

* I accept the use of cookies as well as the terms in the privacy policy. I accept that data provided by me is processed and saved. I know that comments are saved and published after review.