Filling 3D hist with markers of different color that depends of some weight value

Hello Rooters,
I am having data like
x1,y1,z1,w1
x2,y2,z2,w2
x3,y3,z3,w3


How Can i fill 3D histogramTH3 like using Fill(x,y,z), so that the color
of filled marker will be decided by fourth value ‘w’

See the colored boxes example.

Hi Couet, Thanks for the helpful link
According to above link

“BOX2” The boxes’ colors are picked in the current palette according to the bins’ contents

The picked up color corresponds to number of entries in the bin Or it is some how related to
weight arguement that we use while filling TH3 like Fill( x , y , z , w ).

The color and the boxes size are linked to the bin content. So if you fill the w=1 it will be the number of entries.

Thanks Couet,
But can’t we have the the marker for individual entry whose color corresponds to ‘w’, instead of box that represent bin content as a whole.

In my case i basically needs the point cloud such that the color of each point corresponds to its ‘w’.

To do that you would need to use a ntuple not a TH3:

ntuple->Draw("x:y:z:w", "", "col")

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.