Correctly normalize the "histogram" to represent an average of the scalar. Therefore, we correctly show the scalar in a volumetric plot. Moreover, the script has been cleaned up.
made render3d better.