Plotting using TGraph

Hello,t
I have a set of data points in .dat file (displayed). I want to plot those points using TGraph.
Will anybody suggest me the correct way/code?


1 0.24104
2 0.23854
3 0.23386
4 0.236508
5 0.23868
6 0.233240
7 0.23862
8 0.235176
9 0.244960
10 0.24253
11 0.242961
12 0.24990
13 0.25656
14 0.222656
15 0.230351
16 0.13111
17 0.319313
18 0.413368
19 0.365113
20 0.359558
21 0.401128
22 0.378719
23 0.382179
24 0.381899
25 0.436043
26 0.473499

Hi,

For this example I assume your data is in a file called “in.txt”:

TGraph g("in.txt");
g.Draw();

Axel.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.