TGraph multi bar chart

Dear root experts,
I am trying to create a bar chart and compare the results of multiple scenarios all in one graph. I know this is possible using TH1 histograms as shown in $ROOTSYS/tutorials/hist/hbars.C. However, I have character string for x-axis and float numbers for y-axis, so I need to use TGraph. Is there a way to do this in root, and if so can anyone point me to an example? It would be a bummer if I’m forced to plot my results in excel when I’m working with such a powerful package as root. :confused:

Thanks in advance,
Maryam

You can create histograms with strings on the x,y,z axis. see TH1::Fill(const char *, double weight)
see tutorials/tree/cernstaff.C or tutorials/hist/halbels1.C, 2.C

Rene

Dear Rene,

Thanks for your reply. I looked at the examples you suggested. But the problem is I don’t have a histogram, but data points in ascii input files with 3 columns: character, float number (ex:0.4), float number. So I would like to plot the two numbers both on y axis, side by side (not overlaid), exactly as shown in the figure for hbars.C (root.cern.ch/root/html/tutorials … ars.C.html). They only way is to overlay two bar graphs with options “AB” and “A”, but I may need to add more data to it and overlaying makes it look very messy.

Maryam

[quote]
They only way is to overlay two bar graphs with options “AB” and “A”, but I may need to add more data to it and overlaying makes it look very messy.[/quote]

Do you have a small running example showing what you get right now ?