X-Y Line plot

Hi there,

I’m having trouble with creating the proper X-Y plot that fits my needs.
The result that I want to get is a 2D (X-Y) plot whose datapoints are connected as in the first attached image.

Till now I’ve tried TGraph and TH2 as a solution.
However the TGraph doesn’t look how it should look like (see attached image), the connection of the datapoints is rather weird.

The only workaround that I can image now is creating a TH1 which is filled as many times as large the Y-value is for every X + a lot of bins.
Is there another option that I’m missing?

Thanks a lot!
X.pdf (18.8 KB)
DatenKorrChannelX.pdf (174 KB)

Before drawing, try to execute:
graph->Sort();

Yes your x points are not ordered…

Thanks a lot! Why didn’t I see that.