I’m trying to plot some data with errorbars, the data is imported as a numpy array with data[:,0] = measurement, data[:,1] = errors. I can plot the data fine with gnuplot and ROOT.TF1 (don’t ask!), but the following just shows an empty canvas…
can = TCanvas("can","A somp") g = TGraphErrors() g.SetTitle("Helo") g.Draw() for y,ey in muplus: n = g.GetN() g.SetPoint(n, n, y) g.SetPointError(n, 0, ey) g.Draw()
Another question, if I want to define another range on the x axis, I could use SetRangeUser right? instead of the data line number I want the rapidity in the interval from -2 to 2, but that doesn’t seem to work either
I have attached my work file as well.
Any help will be greatly appreciated!
article1.py (2.08 KB)