I did not look at your macro but, from the plots you posted, I see that the axis coordinates are very different in the new plot. Are you sure the boxes and lines drawn in your macro have the correct coordinates in the new axis system?
Hi @cout yes, the axes range are different because they are not same data (!
And yes, I changed the coordinates of lines and boxes in the macro
int x1=1660;
int x2=1720;
double tmin=1660;
double tpeakmin=1684;
double tpeakmax=1686;
double tmax=1720;
auto b1 = new TBox(x1,0,x2,30);
b1->SetFillColorAlpha(kGreen-4,0.5);
b1->Draw();
auto b2 = new TBox(tpeakmin,0,tpeakmax,30);
b2->SetFillColorAlpha(kOrange,0.5);
b2->Draw();
auto lh = new TLine(tpeakmin,30,tpeakmax,30);
lh->SetLineColor(kRed);
lh->SetLineWidth(3.);
lh->Draw();
auto lv1 = new TLine(tpeakmin,1,tpeakmin,200000);
lv1->SetLineColor(kRed);
lv1->SetLineWidth(3.);
lv1->Draw();
auto lv2 = new TLine(tpeakmax,1,tpeakmax,200000);
lv2->SetLineColor(kRed);
lv2->SetLineWidth(3.);
lv2->Draw();