How to get projection on TGraph

Hi,
I have a tree, and I can draw a 2D histogram by the method:

mytree->Draw("mybranch1:mybranch2");

Actually, the returned is not “TH2”, but a “TGraph” named as Graph. Now just based on the graph, I want to plot Profile or Projection on X axis, how can I do that?

Thank you.

Zhiyi.

mytree->Draw("mybranch1:mybranch2","","hist");

Cheers,
Philippe