代码拉取完成,页面将自动刷新
import numpy as np
import matplotlib.pyplot as plt
from color import blackbody
nm = 1e-9
Figure 10.2(a)
lam = np.linspace(300, 1000, 50)
for T in [3000, 4000, 5000, 6000]:
e = blackbody(lam * nm, T)
plt.plot(lam, e, label=f"{T}K")
plt.grid(True)
plt.xlabel('Wavelength (nm)')
plt.ylabel('$E(\lambda)\,\, (W sr^{-1} m^{-2} m^{-1})$')
plt.legend()
<matplotlib.legend.Legend at 0x7fec3d9c15d0>
Figure 10.2(b), need to add human eye response
lam = np.linspace(300, 1000, 50)
e = blackbody(lam * nm, 2600)
plt.plot(lam, e / max(e), label="Tungsten lamp (2600K)")
e = blackbody(lam * nm, 5778)
plt.plot(lam, e / max(e), label="Sun (5778K)")
plt.grid(True)
plt.xlabel('Wavelength (nm)')
plt.ylabel('Normalized $E(\lambda)$')
plt.legend()
<matplotlib.legend.Legend at 0x7fec3e3e1a10>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。