Hi,
I mean to create TGraph from histogram points like this:
TGraph *make_swapped_graph(TH1 *h1) {
// copy all points from histogram
TGraph *gr = new TGraph(h1);
Int_t nbins = gr->GetN();
Double_t x,y;
// swap x/y coordinates
for (int n=0;n<nbins;++n) {
gr->GetPoint(n,x,y);
gr->SetPoint(n,y,x);
}
return gr;
}
And then draw such graphs instead of histograms.
Here is complete macro - with few errors corrections: b2_style_pad.C (7.4 KB)
And produced image.
