Request: plotting colored 2d-Histograms as scatter plors

Dear root-team,

I am permanently plotting two dimensional histograms like the attached one for the ALICE experiment. In ROOT, there are in principle two options how to plot these kind of histograms:

a) a scatter plot which makes n dots (or markers) in a bin with n entries
b) “colz” which colors the entire bin according to the number of entries

In order to make much nicer plots, I would need the following:

A scatter plot which makes n markers in a bin with n entries, and the markers are in addition colored according to the number of entries.

Thanks a lot for your help, Alexander


you have to produce as many TGraph as color values.
This can be done automatically with TTree::Draw, eg

T.Draw("x:y:z","","col"); where z is the variable (or expression) to be mapped to the color index. eg if you use the color palette 1 with 50 colors (gStyle->SetPalette(1)), the variable z will be mapped to 50 colors. Up to you to change the number of colors or scale the expression z such that it scales between 0 and ncolors.