How to create TGraph2D for correlation between two branches of a TTree

Hi, I am new to ROOT! I have a correlation plot of two branches from a TTree which I produced using

tree->Draw("x:y", cuts applied)

but now I would like to obtain a colored plot based on the intensity of points. I understand that TGraph2D has drawing options like PCOL, but I don’t know how could I create TGraph2D from TTree. Any help would be appreciated, thanks!

_ROOT Version: 6.24/02

tree->Draw("x:y", cuts applied,"colz");

Thank you! This worked.