These images were created with my personal Ray Tracing and Image Synthesis Software. They were generated using the following Spectral Function:
The first image was generated by just ignoring the fact that the values of X,Y,Z may not be in the range 0..1. (which they aren't). I just mapped them directly into an RGB. As you notice, the color palette's here will probably recycle themselves (especially in the blue band).
The second image was generated by calculating the min and max values for each of X,Y,Z, and then modify the each value of X,Y,Z in the image so that it fell into the range 0..1. This seemed to be the correct solution, but I did get a strange affect that part of the blue spectrum is missing at the top. I'm still looking into this to determine why.
Both of the previous images are displayed by completely ignoring the 683 scalar in front of the integral. This value is used to transform the values into the proper units of measurement. The next picture is one done using the Min-Max scaling philosophy above, but including the 683 scalar in the calculation. As you can see there isn't much difference involved here.
There was also the question of whether or not to scale based JUST on the Y value. I decided that this probably wasn't the best idea, since we are then possibly losing what we were trying to accomplish in the first place. (all of our values to be in the range 0..1) I also inverted the matrix that was given to us as a sample matrix for a given monitor to produce these results. When I used the non-inverted matrix it gave me very incorrect colors.
The matrix that I used is:
double colorXform[] = { 0.5893, 0.2904, 0.0000,
0.1789, 0.6051, 0.0684,
0.1831, 0.1045, 1.0202 };