Hi everyone, I have a TProfile and I want to connect the points with a line (smooth or not). In TGraph I am able to achieve this through Draw(“ALP”) or just Draw(“AP”) and then Draw(“C”) etc. But it seems that none of those tricks work on TProfile ! It just ignores everything and plots just points and error bars… error bars are fine and I want them but I also would like to draw a line, how can I do that ?
TProfile are histograms. Option L or C should work. Use option HIST to avoid errors
so use option “HIST L” or "HIST C"
all details here: root.cern/doc/master/classTHistPainter.html
[quote=“couet”]TProfile are histograms. Option L or C should work. Use option HIST to avoid errors
so use option “HIST L” or "HIST C"
all details here: root.cern/doc/master/classTHistPainter.html[/quote]
That’s what I thought but it doesn’t seem to work ! And I need the error bars. so I tried to do:
prof->Draw("e1");
prof->Draw("C");
That “C” option just seems to have no effect at all !
I generate X values from -5 to +5, generate random numbers for Y values, collect them in x and y arrays of size “n_entr” (array wasn’t necessary for filling hist anf prof of course, but IO needed them for later, check line # 76). I fill TH2F *hist and TProfile *prof with these arrays and plot them. As I said, prof->Draw(“e1”); and then prof->Draw(“C”)’ or even Draw(“L”); doesn’t change anything . no lines drawn and is also true for the histogram !
In the next step (line # 76 onwards) I do my own averaging over beans and feed a TGraphErrors and show that “C” option works perfectly in TGraphErrors.