Access each point of a TGraph

Hello experts, I have a problem when reading points from Tgraph.
this is the code to read points from tgraph:

when i print out x axis, it’s like:
x_repro [ 1.505 -1.122 2.25 -0.4 1.783 0.4 1.122 -1.783 -2.25 -1.505]

but it supposed to be:
x_repro [-2.25 -1.783 -1.505 -1.122 -0.4 0.4 1.122 1.505 1.783 2.25 ]

i dont know why the sequence is disordered?

Try first: gr.Sort()

1 Like

Points are in the order they were put in the TGraph. You can either revisit the way the graph is filled or apply @Wile_E_Coyote suggestion.

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