Victor Lima
victorporto@ifsc.usp.br
victor.lima@ufscar.br
victorportog.github.io
Release date:
24 March 2025
Last modification:
24 March 2025
Hey! :)
In this tutorial you can check some examples on how to use the functions available in the skinoptics.colors module.
This file is part of SkinOptics documentation.
import numpy as np
import matplotlib
from matplotlib import rcParams
from matplotlib import style
import matplotlib.pyplot as plt
import pandas as pd
print('numpy version:', np.__version__)
print('matplotlib version:', matplotlib.__version__)
print('pandas version:', pd.__version__)
numpy version: 1.26.4 matplotlib version: 3.9.0 pandas version: 2.2.2
rcParams.update({'font.size': 12})
rcParams.update({'axes.labelsize': 12})
rcParams.update({'axes.titlesize': 12})
rcParams.update({'xtick.labelsize': 12})
rcParams.update({'ytick.labelsize': 12})
rcParams.update({'legend.fontsize': 10})
style.use('seaborn-v0_8-colorblind')
rcParams.update({'axes.grid': True})
plt.rcParams["figure.figsize"] = (6, 4)
import skinoptics
from skinoptics.colors import *
print('skinoptics version:', skinoptics.__version__)
skinoptics version: 0.0.1b5
all_lambda = np.arange(300, 830+5, 5)
plt.plot(all_lambda, rspd(all_lambda, 'A'), color = 'r', ls = '-', lw = 2., label = 'A')
plt.plot(all_lambda, rspd(all_lambda, 'D50'), color = 'darkorange', ls = '-', lw = 2., label = 'D50')
all_lambda = np.arange(300, 780+5, 5)
plt.plot(all_lambda, rspd(all_lambda, 'D55'), color = 'g', ls = '-.', lw = 2., label = 'D55')
all_lambda = np.arange(300, 830+5, 5)
plt.plot(all_lambda, rspd(all_lambda, 'D65'), color = 'b', ls = '-', lw = 2., label = 'D65')
all_lambda = np.arange(300, 780+5, 5)
plt.plot(all_lambda, rspd(all_lambda, 'D75'), color = 'purple', ls = '-.', lw = 2., label = 'D75')
plt.xlabel('wavelength [nm]')
plt.ylabel('[-]')
plt.legend(loc = 'upper left')
plt.xlim(300, 830)
plt.ylim(0, 300)
plt.show()
all_lambda = np.arange(360, 830+1, 1)
xbar2_CIE, ybar2_CIE, zbar2_CIE = cmfs(all_lambda, '2o', 'CIE')
xbar10_CIE, ybar10_CIE, zbar10_CIE = cmfs(all_lambda, '10o', 'CIE')
xbar2_Wyman_single, ybar2_Wyman_single, zbar2_Wyman_single = cmfs(all_lambda, '2o', 'Wyman_singlelobe')
xbar10_Wyman_single, ybar10_Wyman_single, zbar10_Wyman_single = cmfs(all_lambda, '10o', 'Wyman_singlelobe')
xbar2_Wyman_multi, ybar2_Wyman_multi, zbar2_Wyman_multi = cmfs(all_lambda, '2o', 'Wyman_multilobe')
plt.plot(all_lambda, xbar2_CIE, 'm', lw = 2., label = '$\\bar{x}_2$($\\lambda$)')
plt.plot(all_lambda, ybar2_CIE, 'y', lw = 2., label = '$\\bar{y}_2$($\\lambda$)')
plt.plot(all_lambda, zbar2_CIE, 'c', lw = 2., label = '$\\bar{z}_2$($\\lambda$)')
plt.plot(all_lambda, xbar10_CIE, '--r', lw = 2., label = '$\\bar{x}_{10}$($\\lambda$)')
plt.plot(all_lambda, ybar10_CIE, '--g', lw = 2., label = '$\\bar{y}_{10}$($\\lambda$)')
plt.plot(all_lambda, zbar10_CIE, '--b', lw = 2., label = '$\\bar{z}_{10}$($\\lambda$)')
plt.xlabel('wavelength [nm]')
plt.ylabel('[-]')
plt.legend(loc = 'upper right')
plt.axis([360, 830, 0, 2.25])
plt.show()
print('bar y (2 degree observer) at 555 nm = ', interp1d(all_lambda, ybar2_CIE)(555))
print('bar y (10 degree observer) at 557 nm = ', interp1d(all_lambda, ybar10_CIE)(557))
bar y (2 degree observer) at 555 nm = 1.0 bar y (10 degree observer) at 557 nm = 1.0
fig, axs = plt.subplots(3, 2,
gridspec_kw = {'hspace': 0.4, 'wspace': 0.25}, figsize = (12, 13))
axs[0,0].plot(all_lambda, xbar2_CIE, 'm', lw = 2.,
label = '$\\bar{x}_2(\\lambda)$\n(CIE 2019)')
axs[0,0].plot(all_lambda, ybar2_CIE, 'y', lw = 2.)
axs[0,0].plot(all_lambda, zbar2_CIE, 'c', lw = 2.)
axs[0,0].plot(all_lambda, xbar2_Wyman_single, '--r', lw = 2.,
label = '$\\bar{x}_2(\\lambda)$\n(Wyman et al. 2013, single-lobe)')
axs[0,0].plot(all_lambda, ybar2_Wyman_single, '--g', lw = 2.)
axs[0,0].plot(all_lambda, zbar2_Wyman_single, '--b', lw = 2.)
axs[0,0].set_xlabel('wavelength [nm]')
axs[0,0].set_ylabel('[-]')
axs[0,0].set_title('(a)', loc = 'left')
axs[0,0].set_xlim(380, 780)
axs[0,0].set_ylim(0, 2.25)
axs[0,0].legend(loc = 'upper right')
axs[1,0].plot(all_lambda, xbar2_CIE, 'm', lw = 2.,
label = '$\\bar{x}_2(\\lambda)$\n(CIE 2019)')
axs[1,0].plot(all_lambda, ybar2_CIE, 'y', lw = 2.)
axs[1,0].plot(all_lambda, zbar2_CIE, 'c', lw = 2.)
axs[1,0].plot(all_lambda, xbar2_Wyman_multi, '--r', lw = 2.,
label = '$\\bar{x}_2(\\lambda)$\n(Wyman et al. 2013, multi-lobe)')
axs[1,0].plot(all_lambda, ybar2_Wyman_multi, '--g', lw = 2.)
axs[1,0].plot(all_lambda, zbar2_Wyman_multi, '--b', lw = 2.)
axs[1,0].set_xlabel('wavelength [nm]')
axs[1,0].set_ylabel('[-]')
axs[1,0].set_xlim(380, 780)
axs[1,0].set_ylim(0, 2.25)
axs[1,0].legend(loc = 'upper right')
axs[1,0].set_title('(c)', loc = 'left')
axs[2,0].plot(all_lambda, xbar10_CIE, 'm', lw = 2.,
label = '$\\bar{x}_{10}(\\lambda)$\n(CIE 2019)')
axs[2,0].plot(all_lambda, ybar10_CIE, 'y', lw = 2.)
axs[2,0].plot(all_lambda, zbar10_CIE, 'c', lw = 2.)
axs[2,0].plot(all_lambda, xbar10_Wyman_single, '--r', lw = 2.,
label = '$\\bar{x}_{10}(\\lambda)$\n(Wyman et al. 2013, single-lobe)')
axs[2,0].plot(all_lambda, ybar10_Wyman_single, '--g', lw = 2.)
axs[2,0].plot(all_lambda, zbar10_Wyman_single, '--b', lw = 2.)
axs[2,0].set_xlabel('wavelength [nm]')
axs[2,0].set_ylabel('[-]')
axs[2,0].set_xlim(380, 780)
axs[2,0].set_ylim(0, 2.2)
axs[2,0].legend(loc = 'upper right')
axs[2,0].set_title('(e)', loc = 'left')
axs[0,1].plot(all_lambda, xbar2_Wyman_single - xbar2_CIE, 'r', lw = 2.,
label = '$\\Delta\\bar{x}_2(\\lambda)$ (single-lobe)')
axs[0,1].plot(all_lambda, ybar2_Wyman_single - ybar2_CIE, 'g', lw = 2.,
label = '$\\Delta\\bar{y}_2(\\lambda)$ (single-lobe)')
axs[0,1].plot(all_lambda, zbar2_Wyman_single - zbar2_CIE, 'b', lw = 2.,
label = '$\\Delta\\bar{z}_2(\\lambda)$ (single-lobe)')
axs[0,1].set_xlabel('wavelength [nm]')
axs[0,1].set_ylabel('difference [-]')
axs[0,1].legend(loc = 'upper right')
axs[0,1].set_xlim(360, 830)
axs[0,1].set_ylim(-0.2, 0.2)
axs[0,1].set_title('(b)', loc = 'left')
axs[1,1].plot(all_lambda, xbar2_Wyman_multi - xbar2_CIE,
'r', lw = 2., label = '$\\Delta\\bar{x}_2(\\lambda)$ (multi-lobe)')
axs[1,1].plot(all_lambda, ybar2_Wyman_multi - ybar2_CIE,
'g', lw = 2., label = '$\\Delta\\bar{y}_2(\\lambda)$ (multi-lobe)')
axs[1,1].plot(all_lambda, zbar2_Wyman_multi - zbar2_CIE,
'b', lw = 2., label = '$\\Delta\\bar{z}_2(\\lambda)$ (multi-lobe)')
axs[1,1].set_xlabel('wavelength [nm]')
axs[1,1].set_ylabel('difference [-]')
axs[1,1].legend(loc = 'upper right')
axs[1,1].set_xlim(360, 830)
axs[1,1].set_ylim(-0.2, 0.2)
axs[1,1].set_title('(d)', loc = 'left')
axs[2,1].plot(all_lambda, xbar10_Wyman_single - xbar10_CIE,
'r', lw = 2., label = '$\\Delta\\bar{x}_{10}(\\lambda)$ (single-lobe)')
axs[2,1].plot(all_lambda, ybar10_Wyman_single - ybar10_CIE,
'g', lw = 2., label = '$\\Delta\\bar{y}_{10}(\\lambda)$ (single-lobe)')
axs[2,1].plot(all_lambda, zbar10_Wyman_single - zbar10_CIE,
'b', lw = 2., label = '$\\Delta\\bar{z}_{10}(\\lambda)$ (single-lobe)')
axs[2,1].set_xlabel('wavelength [nm]')
axs[2,1].set_ylabel('difference [-]')
axs[2,1].legend(loc = 'upper right')
axs[2,1].set_xlim(360, 830)
axs[2,1].set_ylim(-0.2, 0.2)
axs[2,1].set_title('(f)', loc = 'left')
plt.show()
all_R2, all_G2, all_B2 = sRGB_from_XYZ(xbar2_CIE, ybar2_CIE, zbar2_CIE)
plt.plot(all_lambda, all_R2, 'r', lw = 2., label = '$\\bar{r}_2$($\\lambda$)')
plt.plot(all_lambda, all_G2, 'g', lw = 2., label = '$\\bar{g}_2$($\\lambda$)')
plt.plot(all_lambda, all_B2, 'b', lw = 2., label = '$\\bar{b}_2$($\\lambda$)')
plt.axis([360, 830, 0, 1.2])
plt.xlabel('wavelength [nm]')
plt.ylabel('[-]')
plt.legend(loc = 'upper right')
plt.show()
plt.rcParams["figure.figsize"] = (6, 1)
rcParams.update({'axes.grid': False})
spectra_RGB2 = np.array([np.array([all_R2, all_G2, all_B2]).T])
plt.imshow(spectra_RGB2, aspect = 'auto')
wavelengths = np.array([400, 500, 600, 700, 800])
plt.xticks((wavelengths - 360)/1, wavelengths)
plt.yticks([-1], '')
plt.ylim(0,.5)
plt.xlabel('wavelength [nm]')
plt.title('visible spectrum\n (2 degree standard observer)')
plt.show()
rcParams.update({'axes.grid': True})
plt.rcParams["figure.figsize"] = (6, 4)
rcParams.update({'axes.grid': False})
wavelengths = np.array([440, 460, 550, 570, 590, 630])
c = 0
for i in wavelengths - 360:
i = int(i/1)
plt.gca().add_patch(plt.Rectangle((c, 0.), 1., 1.,
fc = spectra_RGB2[0,i,:],
ec = (0, 0, 0)))
c += 1
plt.xticks([0.5, 1.5, 2.5, 3.5, 4.5, 5.5], wavelengths)
plt.yticks([0], '')
plt.xlabel('wavelength [nm]')
plt.axis('scaled')
plt.axis([0, 6, 0, 1])
plt.show()
rcParams.update({'axes.grid': True})
x2_CIE, y2_CIE = xy_from_XYZ(xbar2_CIE, ybar2_CIE, zbar2_CIE)
illuminants = ['A', 'D50', 'D55', 'D65', 'D75']
observers = ['2o', '10o']
index = []
X = []
Y = []
Z = []
x = []
y = []
for j in observers:
for i in illuminants:
index.append('{} {}'.format(i, j))
X.append(np.round(XYZ_wp(illuminant = i, observer = j)[0], 4))
Y.append(np.round(XYZ_wp(illuminant = i, observer = j)[1], 4))
Z.append(np.round(XYZ_wp(illuminant = i, observer = j)[2], 4))
x.append(np.round(xy_wp(illuminant = i, observer = j)[0], 4))
y.append(np.round(xy_wp(illuminant = i, observer = j)[1], 4))
table = {'Xn': X, 'Yn': Y, 'Zn': Z, 'xn': x, 'yn': y}
pd.DataFrame(table, index = index)
Xn | Yn | Zn | xn | yn | |
---|---|---|---|---|---|
A 2o | 1.0985 | 1.0 | 0.3558 | 0.4476 | 0.4074 |
D50 2o | 0.9642 | 1.0 | 0.8251 | 0.3457 | 0.3585 |
D55 2o | 0.9568 | 1.0 | 0.9214 | 0.3324 | 0.3474 |
D65 2o | 0.9505 | 1.0 | 1.0888 | 0.3127 | 0.3290 |
D75 2o | 0.9497 | 1.0 | 1.2262 | 0.2990 | 0.3149 |
A 10o | 1.1114 | 1.0 | 0.3520 | 0.4512 | 0.4059 |
D50 10o | 0.9672 | 1.0 | 0.8142 | 0.3477 | 0.3595 |
D55 10o | 0.9580 | 1.0 | 0.9091 | 0.3341 | 0.3488 |
D65 10o | 0.9481 | 1.0 | 1.0730 | 0.3138 | 0.3310 |
D75 10o | 0.9441 | 1.0 | 1.2062 | 0.2997 | 0.3174 |
fig, ax = plt.subplots(1, 1)
ax.scatter(*xy_wp('A', '2o'), color = 'r', marker = 's', s = 8, label = 'A, 2 degree')
ax.scatter(*xy_wp('D50', '2o'), color = 'darkorange', marker = 's', s = 8, label = 'D50, 2 degree')
ax.scatter(*xy_wp('D55', '2o'), color = 'g', marker = 's', s = 8, label = 'D55, 2 degree')
ax.scatter(*xy_wp('D65', '2o'), color = 'b', marker = 's', s = 8, label = 'D65, 2 degree')
ax.scatter(*xy_wp('D75', '2o'), color = 'purple', marker = 's', s = 8, label = 'D75, 2 degree')
ax.scatter(*xy_wp('A', '10o'), color = 'r', marker = '+', label = 'A, 10 degree')
ax.scatter(*xy_wp('D50', '10o'), color = 'darkorange', marker = '+', label = 'D50, 10 degree')
ax.scatter(*xy_wp('D55', '10o'), color = 'g', marker = '+', label = 'D55, 10 degree')
ax.scatter(*xy_wp('D65', '10o'), color = 'b', marker = '+', label = 'D65, 10 degree')
ax.scatter(*xy_wp('D75', '10o'), color = 'purple', marker = '+', label = 'D75, 10 degree')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.legend(loc = 'upper left')
ax.axis([0.14, 0.48, 0.25, 0.48])
ax.set_aspect('equal')
plt.show()
fig, ax = plt.subplots(1,1)
plt.scatter(x2_CIE, y2_CIE,
color = np.array(sRGB_from_lambda0(all_lambda)).T, marker = '.', label = 'spectral locus (2 degree)')
ax.scatter(*xy_wp('A', '2o'), color = 'r', marker = 's', s = 8, label = 'wp (A, 2 degree)')
ax.scatter(*xy_wp('D50', '2o'), color = 'darkorange', marker = 's', s = 8, label = 'wp (D50, 2 degree)')
ax.scatter(*xy_wp('D55', '2o'), color = 'g', marker = 's', s = 8, label = 'wp (D55, 2 degree)')
ax.scatter(*xy_wp('D65', '2o'), color = 'b', marker = 's', s = 8, label = 'wp (D65, 2 degree)')
ax.scatter(*xy_wp('D75', '2o'), color = 'purple', marker = 's', s = 8, label = 'wp (D75, 2 degree)')
xy_R = (0.64, 0.33)
xy_G = (0.30, 0.60)
xy_B = (0.15, 0.06)
ax.plot([xy_R[0], xy_G[0], xy_B[0], xy_R[0]],
[xy_R[1], xy_G[1], xy_B[1], xy_R[1]], color = 'k', ls = ':', label = 'sRGB color gamut')
ax.scatter(xy_R[0], xy_R[1], color = (1,0,0), marker = '*', label = 'sRGB red primary')
ax.scatter(xy_G[0], xy_G[1], color = (0,1,0), marker = '*', label = 'sRGB green primary')
ax.scatter(xy_B[0], xy_B[1], color = (0,0,1), marker = '*', label = 'sRGB blue primary')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.legend(bbox_to_anchor = (1,1.027), loc = 'upper left')
ax.axis([0, 0.8, 0, 0.9])
ax.set_aspect('equal')
plt.show()
fig, ax = plt.subplots(1, 1)
L = 45
b = 0
for a in [-42, -28, -14, 0, 14, 28, 42]:
R, G, B = sRGB_from_XYZ(*XYZ_from_Lab(L, a, b, observer = '2o'))
ax.scatter(a, b, color = (R, G, B), marker = 's')
a = 0
for b in [-42, -28, -14, 0, 14, 28, 42]:
R, G, B = sRGB_from_XYZ(*XYZ_from_Lab(L, a, b, observer = '2o'))
ax.scatter(a, b, color = (R, G, B), marker = 's')
for hue in [22.5, 45, 67.5, 112.5, 135, 157.5, 202.5, 225, 247.5, 292.5, 315, 337.5]:
for chroma in [14, 28, 42]:
a = chroma*np.cos(hue*np.pi/180)
b = chroma*np.sin(hue*np.pi/180)
R, G, B = sRGB_from_XYZ(*XYZ_from_Lab(L, a, b, observer = '2o'))
ax.scatter(a, b, color = (R, G, B), marker = 's')
ax.set_xlabel('a*')
ax.set_ylabel('b*')
plt.title('L* = {}'.format(L))
ax.set_xticks([-25, 0, 25], ['-25', '0', '25'])
ax.set_yticks([-25, 0, 25], ['-25', '0', '25'])
ax.set_xlim(-50, 50)
ax.set_ylim(-50, 50)
ax.set_aspect('equal')
plt.show()
rcParams.update({'axes.grid': False})
c = 0
for L in [20, 30, 40, 50, 60, 70]:
d = 0
for a in [0, 14, 28, 42]:
b = 0
R, G, B = sRGB_from_XYZ(*XYZ_from_Lab(L, a, b, observer = '2o'))
plt.gca().add_patch(plt.Rectangle((c, d), 1., 1.,
fc = (R, G, B),
ec = (R, G, B)))
d +=1
c += 1
plt.xticks([0.5, 1.5, 2.5, 3.5, 4.5, 5.5], ['20', '30', '40', '50', '60', '70'])
plt.yticks([0.5, 1.5, 2.5, 3.5], ['0', '14', '28', '42'])
plt.xlabel('L*')
plt.ylabel('a*')
plt.axis('scaled')
plt.axis([0, 6, 0, 4])
plt.title('b* = 0')
plt.show()
rcParams.update({'axes.grid': True})
all_lambda = np.arange(360, 830 + 1, 1)
Rd = np.zeros((100 + 1, len(all_lambda)))
X, Y, Z, R, G, B, L, a, b = np.zeros((9, 100 + 1))
for i in range(100 + 1):
Rd[i, :] = i*np.ones(len(all_lambda))
X[i], Y[i], Z[i] = XYZ_from_spectrum(all_lambda, Rd[i, :])
R[i], G[i], B[i] = sRGB_from_spectrum(all_lambda, Rd[i, :])
L[i], a[i], b[i] = Lab_from_spectrum(all_lambda, Rd[i, :])
'''
CIE L*a*b* color space coordinates for Labsphere Spectralon Diffuse Reflectance Standards (DRSs)
measured with a Delta Vista 450G spectrophotometer (D65 illuminant, 10o observer, 8 mm aperture).
Measurements (n = 10 for each standard) made by Victor Lima on May 2023.
'''
DRS_99 = np.array([[98.92, -0.58, 1.12, 100.58],
[98.73, -0.49, 1.19, 99.87],
[98.24, -0.61, 1.42, 98.88],
[99.12, -0.49, 1.02, 100.81],
[98.19, -0.66, 1.45, 98.70],
[98.60, -0.43, 1.14, 100.05],
[98.79, -0.51, 1.18, 99.79],
[98.29, -0.56, 1.35, 99.40],
[98.56, -0.53, 1.35, 99.22],
[99.21, -0.51, 0.95, 101.00]])
DRS_75 = np.array([[90.57, -0.38, 1.08, 79.82],
[90.42, -0.48, 1.08, 79.81],
[90.77, -0.40, 0.92, 80.82],
[90.69, -0.42, 1.02, 80.33],
[90.77, -0.46, 0.97, 80.23],
[90.66, -0.38, 1.04, 80.33],
[90.60, -0.41, 1.07, 80.43],
[90.53, -0.42, 1.03, 79.92],
[90.69, -0.43, 1.02, 80.33],
[90.35, -0.46, 0.98, 79.92]])
DRS_50 = np.array([[75.93, 0.04, 2.39, 53.32],
[76.04, 0.21, 2.39, 53.10],
[76.07, 0.19, 2.27, 53.09],
[75.97, 0.14, 2.37, 53.22],
[75.95, 0.00, 2.42, 53.31],
[76.05, 0.26, 2.25, 53.38],
[75.86, -0.04, 2.52, 53.12],
[76.16, 0.21, 2.33, 53.60],
[76.15, 0.22, 2.23, 53.30],
[75.85, 0.10, 2.25, 53.08]])
DRS_02 = np.array([[12.13, 0.86, 0.32, 1.78],
[12.33, 0.95, -0.24, 1.75],
[12.52, 0.12, 0.06, 1.78],
[12.35, 0.42, 0.68, 1.77],
[12.13, 0.86, 0.32, 1.78],
[12.33, 0.95, -0.24, 1.75],
[12.08, 0.49, 0.23, 1.49],
[12.33, 0.95, -0.24, 1.75],
[12.35, 0.42, 0.68, 1.77]])
print('Delta Vista 450G')
pd.DataFrame(np.round(np.array([[DRS_02[:,0].mean(), DRS_50[:,0].mean(), DRS_75[:,0].mean(), DRS_99[:,0].mean()],
[DRS_02[:,1].mean(), DRS_50[:,1].mean(), DRS_75[:,1].mean(), DRS_99[:,1].mean()],
[DRS_02[:,2].mean(), DRS_50[:,2].mean(), DRS_75[:,2].mean(), DRS_99[:,2].mean()],
[DRS_02[:,0].std(), DRS_50[:,0].std(), DRS_75[:,0].std(), DRS_99[:,0].std()],
[DRS_02[:,1].std(), DRS_50[:,1].std(), DRS_75[:,1].std(), DRS_99[:,1].std()],
[DRS_02[:,2].std(), DRS_50[:,2].std(), DRS_75[:,2].std(), DRS_99[:,2].std()]]), 2),
index = ['mean L* [-]', 'mean a* [-]', 'mean b* [-]', 'std L* [-]', 'std a* [-]', 'std b* [-]'],
columns = ['DRS 99', 'DRS 75', 'DRS 50', 'DRS 02'])
Delta Vista 450G
DRS 99 | DRS 75 | DRS 50 | DRS 02 | |
---|---|---|---|---|
mean L* [-] | 12.28 | 76.00 | 90.60 | 98.66 |
mean a* [-] | 0.67 | 0.13 | -0.42 | -0.54 |
mean b* [-] | 0.17 | 2.34 | 1.02 | 1.22 |
std L* [-] | 0.13 | 0.10 | 0.13 | 0.34 |
std a* [-] | 0.29 | 0.10 | 0.03 | 0.06 |
std b* [-] | 0.35 | 0.09 | 0.05 | 0.16 |
'''
Reflectance Spectra for Labsphere Spectralon Diffuse Reflectance Standards (DRSs)
measured with a Konica Minolta CM-700d spectrophotometer (MAV mask, 8 mm aperture, SCI mode).
Measurements (n = 10 for each standard) made by Lilian Tan Moriyama on September 2024.
'''
all_lambda_ = np.array([400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700])
R_DRS_02 = np.array([[1.98, 1.99, 1.99, 1.99, 1.99, 1.99, 2.00, 1.98, 2.00, 2.02, 2.02, 2.02, 2.02, 2.03, 2.03, 2.03, 2.05, 2.05, 2.05, 2.05, 2.06, 2.06, 2.07, 2.08, 2.07, 2.09, 2.07, 2.10, 2.10, 2.09, 2.10],
[2.00, 2.02, 2.04, 2.03, 2.02, 2.01, 2.03, 2.02, 2.04, 2.05, 2.04, 2.03, 2.04, 2.05, 2.07, 2.06, 2.09, 2.09, 2.09, 2.08, 2.10, 2.11, 2.11, 2.09, 2.12, 2.10, 2.12, 2.14, 2.15, 2.13, 2.14],
[1.94, 1.94, 1.95, 1.95, 1.95, 1.95, 1.96, 1.94, 1.96, 1.97, 1.97, 1.97, 1.96, 1.98, 1.99, 1.99, 2.00, 2.00, 2.00, 2.00, 2.02, 2.03, 2.04, 2.03, 2.03, 2.04, 2.03, 2.06, 2.06, 2.04, 2.05],
[1.94, 1.96, 1.94, 1.96, 1.96, 1.95, 1.97, 1.95, 1.97, 1.97, 1.96, 1.97, 1.98, 1.98, 2.00, 1.99, 2.00, 2.01, 2.01, 2.01, 2.01, 2.03, 2.02, 2.03, 2.03, 2.04, 2.03, 2.06, 2.06, 2.06, 2.07],
[1.91, 1.92, 1.93, 1.94, 1.94, 1.94, 1.94, 1.94, 1.95, 1.95, 1.94, 1.95, 1.95, 1.96, 1.96, 1.97, 1.97, 1.98, 1.99, 2.00, 2.00, 2.01, 2.01, 1.99, 2.02, 2.01, 2.00, 2.04, 2.03, 2.04, 2.05],
[2.01, 2.02, 2.04, 2.04, 2.04, 2.03, 2.05, 2.05, 2.05, 2.06, 2.05, 2.06, 2.05, 2.07, 2.08, 2.08, 2.08, 2.10, 2.10, 2.11, 2.11, 2.11, 2.12, 2.12, 2.11, 2.12, 2.14, 2.14, 2.15, 2.13, 2.15],
[2.04, 2.05, 2.06, 2.06, 2.07, 2.06, 2.08, 2.06, 2.08, 2.09, 2.08, 2.08, 2.08, 2.10, 2.11, 2.11, 2.12, 2.11, 2.13, 2.13, 2.14, 2.15, 2.13, 2.16, 2.16, 2.15, 2.15, 2.16, 2.18, 2.17, 2.18],
[1.96, 1.97, 1.97, 1.98, 1.98, 1.97, 1.99, 1.98, 1.99, 1.99, 2.00, 2.00, 1.99, 2.01, 2.01, 2.02, 2.03, 2.04, 2.03, 2.04, 2.05, 2.06, 2.07, 2.05, 2.06, 2.05, 2.07, 2.09, 2.08, 2.09, 2.09],
[1.99, 1.98, 1.99, 2.01, 2.00, 2.00, 2.03, 2.00, 2.03, 2.04, 2.03, 2.02, 2.03, 2.04, 2.04, 2.04, 2.05, 2.07, 2.07, 2.08, 2.08, 2.07, 2.10, 2.09, 2.09, 2.10, 2.09, 2.11, 2.11, 2.10, 2.12],
[1.98, 1.99, 2.01, 2.01, 2.01, 2.01, 2.02, 2.01, 2.02, 2.03, 2.02, 2.02, 2.03, 2.04, 2.05, 2.05, 2.06, 2.08, 2.07, 2.07, 2.07, 2.08, 2.09, 2.09, 2.11, 2.10, 2.09, 2.11, 2.11, 2.12, 2.13]])
R_DRS_50 = np.array([[46.02, 46.22, 46.37, 46.53, 46.73, 46.98, 47.11, 47.22, 47.44, 47.63, 47.78, 47.99, 48.20, 48.42, 48.60, 48.75, 48.92, 49.10, 49.29, 49.47, 49.63, 49.80, 49.94, 50.16, 50.30, 50.44, 50.61, 50.79, 50.96, 51.14, 51.27],
[46.19, 46.35, 46.49, 46.64, 46.79, 47.00, 47.14, 47.25, 47.45, 47.64, 47.78, 47.98, 48.16, 48.37, 48.55, 48.70, 48.85, 49.04, 49.20, 49.37, 49.54, 49.68, 49.84, 50.05, 50.17, 50.31, 50.52, 50.66, 50.84, 51.02, 51.14],
[45.95, 46.12, 46.26, 46.41, 46.57, 46.77, 46.92, 47.07, 47.28, 47.45, 47.60, 47.79, 47.97, 48.17, 48.33, 48.49, 48.65, 48.85, 49.01, 49.20, 49.36, 49.49, 49.65, 49.86, 50.00, 50.12, 50.34, 50.50, 50.69, 50.86, 50.98],
[46.21, 46.38, 46.54, 46.69, 46.84, 47.07, 47.22, 47.38, 47.58, 47.77, 47.92, 48.10, 48.28, 48.49, 48.66, 48.81, 48.98, 49.18, 49.34, 49.54, 49.69, 49.84, 49.99, 50.20, 50.35, 50.48, 50.69, 50.83, 51.01, 51.20, 51.31],
[45.66, 45.88, 46.05, 46.21, 46.39, 46.61, 46.77, 46.93, 47.15, 47.32, 47.50, 47.68, 47.88, 48.08, 48.25, 48.41, 48.58, 48.79, 48.96, 49.15, 49.33, 49.46, 49.62, 49.84, 50.00, 50.09, 50.31, 50.48, 50.67, 50.83, 50.96],
[46.00, 46.17, 46.31, 46.46, 46.63, 46.85, 47.01, 47.15, 47.35, 47.54, 47.70, 47.87, 48.05, 48.27, 48.44, 48.60, 48.75, 48.96, 49.12, 49.32, 49.49, 49.62, 49.78, 49.99, 50.15, 50.25, 50.48, 50.62, 50.81, 50.97, 51.10],
[46.18, 46.33, 46.48, 46.61, 46.77, 46.98, 47.12, 47.27, 47.47, 47.63, 47.78, 47.96, 48.14, 48.33, 48.50, 48.66, 48.80, 49.01, 49.16, 49.35, 49.50, 49.66, 49.81, 50.03, 50.18, 50.29, 50.51, 50.67, 50.85, 51.02, 51.15],
[46.34, 46.50, 46.64, 46.78, 46.94, 47.14, 47.29, 47.43, 47.64, 47.79, 47.96, 48.13, 48.31, 48.51, 48.68, 48.84, 48.99, 49.18, 49.33, 49.54, 49.68, 49.84, 49.98, 50.20, 50.34, 50.45, 50.67, 50.82, 51.01, 51.19, 51.31],
[46.00, 46.17, 46.32, 46.46, 46.62, 46.84, 46.98, 47.12, 47.31, 47.49, 47.65, 47.84, 48.01, 48.23, 48.40, 48.55, 48.69, 48.89, 49.05, 49.25, 49.40, 49.55, 49.70, 49.92, 50.07, 50.17, 50.38, 50.55, 50.73, 50.89, 51.03],
[45.90, 46.08, 46.22, 46.37, 46.53, 46.76, 46.89, 47.01, 47.21, 47.39, 47.55, 47.73, 47.93, 48.15, 48.32, 48.47, 48.61, 48.81, 48.97, 49.16, 49.31, 49.45, 49.62, 49.84, 49.99, 50.10, 50.28, 50.46, 50.64, 50.81, 50.94]])
R_DRS_75 = np.array([[73.94, 74.06, 74.09, 74.13, 74.22, 74.38, 74.37, 74.33, 74.34, 74.46, 74.50, 74.60, 74.70, 74.81, 74.90, 74.91, 74.94, 75.01, 75.03, 75.07, 75.12, 75.17, 75.20, 75.32, 75.36, 75.36, 75.41, 75.49, 75.57, 75.68, 75.70],
[74.07, 74.16, 74.21, 74.25, 74.31, 74.44, 74.46, 74.49, 74.56, 74.63, 74.66, 74.74, 74.82, 74.90, 74.95, 74.98, 75.03, 75.12, 75.12, 75.20, 75.25, 75.27, 75.30, 75.42, 75.46, 75.45, 75.52, 75.57, 75.63, 75.71, 75.71],
[74.07, 74.19, 74.21, 74.24, 74.27, 74.40, 74.42, 74.45, 74.50, 74.58, 74.59, 74.67, 74.71, 74.80, 74.85, 74.85, 74.89, 74.97, 74.98, 75.04, 75.08, 75.09, 75.12, 75.23, 75.28, 75.25, 75.35, 75.37, 75.44, 75.51, 75.51],
[74.47, 74.57, 74.60, 74.62, 74.68, 74.81, 74.83, 74.86, 74.93, 74.98, 75.01, 75.10, 75.16, 75.24, 75.29, 75.30, 75.34, 75.44, 75.43, 75.52, 75.56, 75.58, 75.63, 75.71, 75.79, 75.75, 75.84, 75.88, 75.96, 76.02, 76.01],
[74.33, 74.41, 74.44, 74.44, 74.49, 74.63, 74.63, 74.66, 74.73, 74.78, 74.80, 74.87, 74.92, 75.01, 75.06, 75.07, 75.09, 75.18, 75.17, 75.25, 75.29, 75.31, 75.34, 75.45, 75.51, 75.46, 75.55, 75.58, 75.65, 75.71, 75.71],
[74.56, 74.61, 74.63, 74.66, 74.71, 74.85, 74.84, 74.82, 74.87, 74.97, 74.98, 75.06, 75.11, 75.23, 75.28, 75.29, 75.30, 75.39, 75.40, 75.47, 75.50, 75.52, 75.56, 75.69, 75.73, 75.68, 75.77, 75.81, 75.86, 75.94, 75.92],
[74.70, 74.78, 74.80, 74.81, 74.86, 75.00, 74.98, 74.97, 75.04, 75.09, 75.12, 75.20, 75.27, 75.37, 75.42, 75.44, 75.44, 75.52, 75.51, 75.59, 75.63, 75.64, 75.66, 75.78, 75.81, 75.79, 75.87, 75.92, 75.97, 76.04, 76.03],
[74.28, 74.36, 74.39, 74.43, 74.46, 74.61, 74.61, 74.61, 74.68, 74.76, 74.77, 74.83, 74.88, 74.98, 75.04, 75.05, 75.05, 75.14, 75.14, 75.21, 75.24, 75.26, 75.29, 75.40, 75.44, 75.40, 75.50, 75.55, 75.60, 75.68, 75.67],
[74.35, 74.44, 74.48, 74.52, 74.58, 74.73, 74.72, 74.73, 74.81, 74.90, 74.91, 74.99, 75.04, 75.15, 75.21, 75.23, 75.24, 75.34, 75.33, 75.42, 75.46, 75.47, 75.51, 75.64, 75.69, 75.64, 75.74, 75.78, 75.85, 75.92, 75.91],
[74.42, 74.49, 74.51, 74.55, 74.58, 74.71, 74.71, 74.71, 74.81, 74.86, 74.88, 74.94, 74.97, 75.07, 75.11, 75.13, 75.13, 75.24, 75.23, 75.31, 75.34, 75.36, 75.38, 75.50, 75.54, 75.50, 75.60, 75.64, 75.70, 75.76, 75.74]])
R_DRS_99 = np.array([[91.85, 92.91, 93.19, 93.35, 93.50, 93.74, 93.86, 93.93, 94.07, 94.34, 94.45, 94.74, 94.92, 95.08, 95.25, 95.34, 95.42, 95.53, 95.55, 95.59, 95.66, 95.75, 95.78, 95.91, 95.98, 96.11, 96.22, 96.45, 96.61, 96.80, 96.86],
[88.26, 90.23, 90.71, 90.93, 91.16, 91.46, 91.66, 91.82, 92.10, 92.46, 92.71, 93.13, 93.46, 93.69, 93.91, 94.02, 94.13, 94.22, 94.23, 94.26, 94.36, 94.43, 94.48, 94.63, 94.76, 94.95, 95.16, 95.47, 95.71, 95.96, 96.08],
[90.78, 91.88, 92.20, 92.41, 92.58, 92.86, 93.00, 93.13, 93.29, 93.60, 93.75, 94.06, 94.28, 94.48, 94.65, 94.74, 94.81, 94.92, 94.93, 94.97, 95.06, 95.13, 95.17, 95.33, 95.41, 95.56, 95.75, 96.03, 96.21, 96.45, 96.53],
[89.92, 91.44, 91.85, 92.06, 92.26, 92.53, 92.70, 92.88, 93.11, 93.39, 93.60, 93.95, 94.20, 94.39, 94.58, 94.67, 94.76, 94.85, 94.87, 94.91, 94.98, 95.05, 95.09, 95.23, 95.36, 95.51, 95.71, 95.95, 96.16, 96.37, 96.44],
[91.79, 92.85, 93.14, 93.30, 93.43, 93.68, 93.81, 93.91, 94.08, 94.32, 94.47, 94.72, 94.91, 95.06, 95.22, 95.29, 95.36, 95.46, 95.47, 95.52, 95.59, 95.64, 95.67, 95.81, 95.91, 96.01, 96.15, 96.34, 96.54, 96.72, 96.79],
[88.14, 89.98, 90.48, 90.76, 90.97, 91.28, 91.50, 91.73, 91.98, 92.36, 92.64, 93.01, 93.31, 93.57, 93.79, 93.90, 94.00, 94.13, 94.13, 94.20, 94.28, 94.34, 94.39, 94.56, 94.72, 94.88, 95.12, 95.40, 95.68, 95.91, 96.01],
[91.47, 92.50, 92.81, 93.01, 93.17, 93.43, 93.56, 93.72, 93.87, 94.11, 94.28, 94.53, 94.73, 94.88, 95.05, 95.14, 95.22, 95.36, 95.36, 95.44, 95.51, 95.55, 95.59, 95.72, 95.86, 95.95, 96.11, 96.33, 96.50, 96.70, 96.74],
[89.98, 91.48, 91.88, 92.11, 92.29, 92.57, 92.74, 92.93, 93.16, 93.46, 93.70, 94.00, 94.25, 94.47, 94.65, 94.74, 94.82, 94.95, 94.93, 94.99, 95.08, 95.10, 95.15, 95.29, 95.46, 95.55, 95.79, 95.99, 96.20, 96.40, 96.47],
[88.92, 90.89, 91.39, 91.62, 91.81, 92.09, 92.26, 92.46, 92.70, 93.04, 93.32, 93.66, 93.94, 94.21, 94.40, 94.49, 94.55, 94.66, 94.62, 94.70, 94.75, 94.78, 94.82, 94.99, 95.14, 95.25, 95.55, 95.81, 96.08, 96.32, 96.40],
[89.13, 90.79, 91.26, 91.50, 91.70, 91.99, 92.16, 92.34, 92.59, 92.90, 93.17, 93.50, 93.75, 94.01, 94.22, 94.30, 94.37, 94.49, 94.48, 94.57, 94.64, 94.67, 94.73, 94.90, 95.05, 95.15, 95.39, 95.64, 95.87, 96.09, 96.16]])
L_DRS_02, a_DRS_02, b_DRS_02 = np.zeros([3,10])
L_DRS_50, a_DRS_50, b_DRS_50 = np.zeros([3,10])
L_DRS_75, a_DRS_75, b_DRS_75 = np.zeros([3,10])
L_DRS_99, a_DRS_99, b_DRS_99 = np.zeros([3,10])
for i in range(10):
L_DRS_02[i], a_DRS_02[i], b_DRS_02[i] = np.round(Lab_from_spectrum(all_lambda_, R_DRS_02[i,:]), 2)
L_DRS_50[i], a_DRS_50[i], b_DRS_50[i] = np.round(Lab_from_spectrum(all_lambda_, R_DRS_50[i,:]), 2)
L_DRS_75[i], a_DRS_75[i], b_DRS_75[i] = np.round(Lab_from_spectrum(all_lambda_, R_DRS_75[i,:]), 2)
L_DRS_99[i], a_DRS_99[i], b_DRS_99[i] = np.round(Lab_from_spectrum(all_lambda_, R_DRS_99[i,:]), 2)
print('Konica Minolta')
pd.DataFrame(np.round(np.array([[L_DRS_02.mean(), DRS_50[:,0].mean(), DRS_75[:,0].mean(), DRS_99[:,0].mean()],
[a_DRS_02.mean(), DRS_50[:,1].mean(), DRS_75[:,1].mean(), DRS_99[:,1].mean()],
[b_DRS_02.mean(), DRS_50[:,2].mean(), DRS_75[:,2].mean(), DRS_99[:,2].mean()],
[L_DRS_02.std(), DRS_50[:,0].std(), DRS_75[:,0].std(), DRS_99[:,0].std()],
[L_DRS_02.std(), DRS_50[:,1].std(), DRS_75[:,1].std(), DRS_99[:,1].std()],
[L_DRS_02.std(), DRS_50[:,2].std(), DRS_75[:,2].std(), DRS_99[:,2].std()]]), 2),
index = ['mean L* [-]', 'mean a* [-]', 'mean b* [-]', 'std L* [-]', 'std a* [-]', 'std b* [-]'],
columns = ['DRS 99', 'DRS 75', 'DRS 50', 'DRS 02'])
Konica Minolta
DRS 99 | DRS 75 | DRS 50 | DRS 02 | |
---|---|---|---|---|
mean L* [-] | 15.68 | 76.00 | 90.60 | 98.66 |
mean a* [-] | 0.19 | 0.13 | -0.42 | -0.54 |
mean b* [-] | 0.36 | 2.34 | 1.02 | 1.22 |
std L* [-] | 0.21 | 0.10 | 0.13 | 0.34 |
std a* [-] | 0.21 | 0.10 | 0.03 | 0.06 |
std b* [-] | 0.21 | 0.09 | 0.05 | 0.16 |
fig, axs = plt.subplots(2, 2,
gridspec_kw = {'wspace': 0.25, 'hspace': 0.4}, figsize = (12, 9))
all_alpha = np.arange(100 + 1)*0.01
axs[0,0].plot(all_alpha*100, 116*f_Lab_from_XYZ(all_alpha) - 16, 'k', lw = 2., label = 'theoretical')
axs[0,0].plot(np.arange(0, 101, 1), L, '--c', lw = 2., label = 'skinoptics.colors')
axs[0,0].errorbar(99, DRS_99[:,0].mean(), DRS_99[:,0].std(), color = 'darkgray', fmt = 's', label = 'Labsphere DRSs,\nDelta Vista 450G')
axs[0,0].errorbar(75, DRS_75[:,0].mean(), DRS_75[:,0].std(), color = 'darkgray', fmt = 's')
axs[0,0].errorbar(50, DRS_50[:,0].mean(), DRS_50[:,0].std(), color = 'darkgray', fmt = 's')
axs[0,0].errorbar(2, DRS_02[:,0].mean(), DRS_02[:,0].std(), color = 'darkgray', fmt = 's')
axs[0,0].errorbar(99, L_DRS_99.mean(), L_DRS_99.std(), color = 'k', fmt = 'o', label = 'Labsphere DRSs,\nKonica Minolta CM-700d')
axs[0,0].errorbar(75, L_DRS_75.mean(), L_DRS_75.std(), color = 'k', fmt = 'o')
axs[0,0].errorbar(50, L_DRS_50.mean(), L_DRS_50.std(), color = 'k', fmt = 'o')
axs[0,0].errorbar(2, L_DRS_02.mean(), L_DRS_02.std(), color = 'k', fmt = 'o')
axs[0,0].set_xlabel('$\\alpha$ [%]')
axs[0,0].set_ylabel('L*')
axs[0,0].set_title('(a)', loc = 'left')
axs[0,0].set_xlim(0, 100)
axs[0,0].set_ylim(0, 100)
axs[0,0].legend()
axs[0,1].plot(all_alpha*100, np.zeros(len(all_alpha)), 'k', lw = 2., label = 'theoretical')
axs[0,1].plot(np.arange(0, 101, 1), a, color = 'm', ls = '--', lw = 2., label = 'skinoptics.colors')
axs[0,1].errorbar(99, DRS_99[:,1].mean(), DRS_99[:,1].std(), color = 'darkgray', fmt = 's', label = 'Labsphere DRSs,\nDelta Vista 450G')
axs[0,1].errorbar(75, DRS_75[:,1].mean(), DRS_75[:,1].std(), color = 'darkgray', fmt = 's')
axs[0,1].errorbar(50, DRS_50[:,1].mean(), DRS_50[:,1].std(), color = 'darkgray', fmt = 's')
axs[0,1].errorbar(2, DRS_02[:,1].mean(), DRS_02[:,1].std(), color = 'darkgray', fmt = 's')
axs[0,1].errorbar(99, a_DRS_99.mean(), a_DRS_99.std(), color = 'k', fmt = 'o', label = 'Labsphere DRSs,\nKonica Minolta CM-700d')
axs[0,1].errorbar(75, a_DRS_75.mean(), a_DRS_75.std(), color = 'k', fmt = 'o')
axs[0,1].errorbar(50, a_DRS_50.mean(), a_DRS_50.std(), color = 'k', fmt = 'o')
axs[0,1].errorbar(2, a_DRS_02.mean(), a_DRS_02.std(), color = 'k', fmt = 'o')
axs[0,1].set_xlabel('$\\alpha$ [%]')
axs[0,1].set_ylabel('a*')
axs[0,1].set_title('(b)', loc = 'left')
axs[0,1].legend(loc = 'lower right')
axs[0,1].set_xlim(0, 100)
axs[0,1].set_ylim(-8, 4)
axs[1,0].plot(all_alpha*100, np.zeros(len(all_alpha)), 'k', lw = 2., label = 'theoretical')
axs[1,0].plot(np.arange(0, 101, 1), b, color = 'gold', ls = '--', lw = 2., label = 'skinoptics.colors')
axs[1,0].errorbar(99, DRS_99[:,2].mean(), DRS_99[:,2].std(), color = 'darkgray', fmt = 's', label = 'Labsphere DRSs,\nDelta Vista 450G')
axs[1,0].errorbar(75, DRS_75[:,2].mean(), DRS_75[:,2].std(), color = 'darkgray', fmt = 's')
axs[1,0].errorbar(50, DRS_50[:,2].mean(), DRS_50[:,2].std(), color = 'darkgray', fmt = 's')
axs[1,0].errorbar(2, DRS_02[:,2].mean(), DRS_02[:,2].std(), color = 'darkgray', fmt = 's')
axs[1,0].errorbar(99, b_DRS_99.mean(), b_DRS_99.std(), color = 'k', fmt = 'o', label = 'Labsphere DRSs,\nKonica Minolta CM-700d')
axs[1,0].errorbar(75, b_DRS_75.mean(), b_DRS_75.std(), color = 'k', fmt = 'o')
axs[1,0].errorbar(50, b_DRS_50.mean(), b_DRS_50.std(), color = 'k', fmt = 'o')
axs[1,0].errorbar(2, b_DRS_02.mean(), b_DRS_02.std(), color = 'k', fmt = 'o')
axs[1,0].set_xlabel('$\\alpha$ [%]')
axs[1,0].set_ylabel('b*')
axs[1,0].set_title('(c)', loc = 'left')
axs[1,0].legend(loc = 'lower right')
axs[1,0].set_xlim(0, 100)
axs[1,0].set_ylim(-8, 4)
axs[1,1].plot(all_lambda_, np.mean(R_DRS_99, axis = 0), color = 'k', ls = ':', lw = 2., label = 'Labsphere DRS 99%')
axs[1,1].plot(all_lambda_, np.mean(R_DRS_75, axis = 0), color = 'k', ls = '--', lw = 2., label = 'Labsphere DRS 75%')
axs[1,1].plot(all_lambda_, np.mean(R_DRS_50, axis = 0), color = 'k', ls = '-.', lw = 2., label = 'Labsphere DRS 50%')
axs[1,1].plot(all_lambda_, np.mean(R_DRS_02, axis = 0), color = 'k', ls = '-', lw = 2., label = 'Labsphere DRS 2%')
axs[1,1].set_yticks([2, 50, 75, 99], ['2', '50', '75', '99'])
axs[1,1].set_xlabel('wavelength [nm]')
axs[1,1].set_ylabel('reflectance [%]')
axs[1,1].set_title('(d)', loc = 'left')
axs[1,1].set_xlim(400, 700)
axs[1,1].set_ylim(0, 100)
axs[1,1].legend(loc = 'center', bbox_to_anchor = (0.75, 0.25))
plt.show()
rcParams.update({'axes.grid': False})
reflectance = np.array([0, 2, 20, 50, 75, 100])
c = 0
for i in reflectance:
plt.gca().add_patch(plt.Rectangle((c, 0.), 1., 1.,
fc = (R[i], G[i], B[i]),
ec = (R[i], G[i], B[i])))
c += 1
plt.xticks([0.5, 1.5, 2.5, 3.5, 4.5, 5.5], ['0', '2', '20', '50', '75', '99'])
plt.yticks([0.5], ['ideal grayscale DRSs'])
plt.xlabel('$\\alpha$ [%]')
plt.axis('scaled')
plt.axis([0, 6, 0, 1])
plt.show()
rcParams.update({'axes.grid': True})