Examples - Blackbody colors
Demonstration of Pyxplot's in-built capability to produce color representations of arbitrary electromagnetic spectra.
Pyxplot's built-in functions include a function for generating color objects which match the color of any given spectrum of light, specified as a function object which takes a wavelength as its single argument. Here, we use this to depict the colors of blackbodies with different characteristic temperatures.
We renormalise the brightnesses of the blackbodies with T^-4 to avoid them becoming so bright that they saturate to white. It is evident that the blackbodies get bluer at hotter temperatures, and they also appear fainter because more of their light is being emitted in the ultraviolet, where is it not visible to the human eye.
set log x set linear y set nokey set nocolkey set size 11 ratio 0.2 set noytics set xlabel 'Temperature' set noylabel f(lambda) = phy.Bv(phy.c/lambda,c1) / (c1**4 / unit(6000*K)**4) set colmap colors.spectrum(f,3e3) set sample grid 200x2 set c1range norenorm set title 'Colors of blackbodies of different temperatures' plot [unit(2000*K):unit(20000*K)] x with colormap