Hi, I’m a beginner at using ROOT and I’m trying to plot a graph using data from a txt file, but for a reason my txt file can’t be opened. This is the error message I get in the root terminal:
root [1] g = new TGraph(“data.txt”)
Error in TGraph::TGraph: Cannot open file: data.txt, TGraph is Zombie
(TGraph *) 0x7faff5900500
data.txt is in the same directory where all my macros are which have worked so far, so the location should be no problem. When I write a macro and include the above line and try to execute it, I get the same message “Cannot open file … TGraph is Zombie” and when I do g->Draw(), I get an empty canvas (which is no surprise if data.txt can’t be opened) and I also get an error message “illegal number of points(0)” (which also makes sense) So I think the problem is with not being able to open data.txt
Yes, they are. (Also, I’m not sure how to give the full path in the root terminal)
EDIT I deleted data.txt from that directory, and I got the very same error message when data.txt was still there.
Thanks a lot, finally I didn’t get the error message using the full path, but now only 1 data point is plotted, (and there are 14 data points.) The range of the x and y axis is too small for the other data points to be seen, and I can’t seem to find a reference for how to change that with TGraph. Have you ever had that issue?