Rainbow color map in 3D

Hello ROOT Experts,
I am having data for 3D points (x, y, z),

What i want is something like this.
I want to divide the 3D space in the in “n x n x n” voxels,
Now for each point data that i am having, i want to fill the corresponding voxel with color intensity corresponding to z value of that point, so that i can have different colored 3d voxel for points with different z.

How can we achieve this in ROOT.

Thanks and with Regards,
Raman

root.cern.ch/doc/master/classTH … html#HP290

Thanks couet,

One more question,
What is saw is that the default voxel color is set to something blue or purple,
Is it possible to have a default voxel color of white. so that i get only those voxel
colored whose bin content is set to some value.

Thanks,
Raman

You can change the color map. There is many here:

root.cern.ch/doc/master/classTColor.html#C06

You can also create your own as explained here:

root.cern.ch/doc/master/classTColor.html#C05