From 5.18 to 5.20 Frame?

Dear all

running the code:

[code]{
Int_t ncx=100;
Int_t ncy=100;
Double_t xmin=-0.4;
Double_t ymin=0.;
Double_t xmax=0.6;
Double_t ymax=3.;
TCanvas *c1 = new TCanvas (“c1”,"XMinus ",200,10,400,600);
c1->cd();

TH2F* frame = new TH2F(“frame”,"",ncx,xmin,xmax,ncy,ymin,ymax);

frame->SetYTitle(" “);
frame->GetXaxis()->CenterTitle();
frame->SetXTitle(” ");
frame->SetLabelOffset(10.0,“y”);
frame->Draw(“same”);
TPaveText* hidebox = new TPaveText(xmin,ymin,xmax,ymax);
hidebox->SetLineColor(10);
hidebox->SetBorderSize(0);
hidebox->SetLineWidth(1);
hidebox->SetFillColor(10);
hidebox->Draw(“same”);

TLine *l = new TLine(xmin,1.,xmax,1.);
l->SetLineStyle(2);
l->Draw(“same”);
l = new TLine(xmin,2.,xmax,2.);
l->SetLineStyle(2);l->Draw(“same”);
l = new TLine(xmin,3.,xmax,3.);
l->SetLineStyle(2);l->Draw(“same”);
l = new TLine(xmin,4.,xmax,4.);
l->SetLineStyle(2);l->Draw(“same”);
l = new TLine(xmin,5.,xmax,5.);
l->SetLineStyle(2);l->Draw(“same”);
l = new TLine(xmin,ymin,xmax,ymin);
l->SetLineStyle(1);l->Draw(“same”);
l = new TLine(xmin,ymax,xmax,ymax);
l->SetLineStyle(1);l->Draw(“same”);
l = new TLine(xmin,ymin,xmin,ymax);
l->SetLineStyle(1);l->Draw(“same”);
l = new TLine(xmax,ymin,xmax,ymax);
l->SetLineStyle(1);l->Draw(“same”);
l = new TLine(0.,ymin,0.,ymax);
l->SetLineStyle(1);l->Draw(“same”);

gStyle->SetEndErrorSize(4);
Int_t nBabGLW = 3;
Float_t XplusBabGLW[nBabGLW] = {0.10, -0.02,0.36 };
Float_t yBabGLW[nBabGLW] = {0.75,1.75,2.75};
// create the error arrays
Float_t eStatXplusBabGLW[nBabGLW] = {0.05, 0.06,0.14};
Float_t eTotXplusBabGLW[nBabGLW];
Float_t eSystXplusBabGLW[nBabGLW] = {0.03, 0.02, 0.05};
Float_t eyBabGLW[nBabGLW] = {0.,0.,0.};
for (Int_t i=0; i<nBabGLW; i++)
{
eTotXplusBabGLW[i] = sqrt(eStatXplusBabGLW[i]*eStatXplusBabGLW[i]+eSystXplusBabGLW[i]*eSystXplusBabGLW[i]);
}
gr = new TGraphAsymmErrors(nBabGLW,XplusBabGLW,yBabGLW,eStatXplusBabGLW,eStatXplusBabGLW,eyBabGLW,eyBabGLW);
gr->SetMarkerColor(8);
gr->SetMarkerStyle(20);
gr->SetMarkerSize(2);
gr->SetLineColor(8);
gr->SetLineWidth(2);
gr->Draw(“P”);
grb = new TGraphAsymmErrors(nBabGLW,XplusBabGLW,yBabGLW,eTotXplusBabGLW,eTotXplusBabGLW,eyBabGLW,eyBabGLW);
grb->SetMarkerColor(8);
grb->SetMarkerStyle(20);
grb->SetMarkerSize(2);
grb->SetLineColor(8);
grb->SetLineWidth(2);
grb->Draw(“P”);

gStyle->SetEndErrorSize(4);
Int_t nBabGGSZ = 3;
Float_t XplusBabGGSZ[nBabGGSZ] = {0.090, -0.111,0.115 };
Float_t yBabGGSZ[nBabGGSZ] = {0.5,1.5,2.5};
// create the error arrays
Float_t eStatXplusBabGGSZ[nBabGGSZ] = {0.043, 0.069,0.138};
Float_t eTotXplusBabGGSZ[nBabGGSZ];
Float_t eSystXplusBabGGSZ[nBabGGSZ] = {0.019, 0.015, 0.041};
Float_t eyBabGGSZ[nBabGGSZ] = {0.,0.,0.};
for (Int_t i=0; i<nBabGGSZ; i++)
{
eTotXplusBabGGSZ[i] = sqrt(eStatXplusBabGGSZ[i]*eStatXplusBabGGSZ[i]+eSystXplusBabGGSZ[i]*eSystXplusBabGGSZ[i]);
}
gr = new TGraphAsymmErrors(nBabGGSZ,XplusBabGGSZ,yBabGGSZ,eStatXplusBabGGSZ,eStatXplusBabGGSZ,eyBabGGSZ,eyBabGGSZ);
gr->SetMarkerColor(2);
gr->SetMarkerStyle(20);
gr->SetMarkerSize(2);
gr->SetLineColor(2.);
gr->SetLineWidth(2.);
gr->Draw(“P”);
grb = new TGraphAsymmErrors(nBabGGSZ,XplusBabGGSZ,yBabGGSZ,eTotXplusBabGGSZ,eTotXplusBabGGSZ,eyBabGGSZ,eyBabGGSZ);
grb->SetMarkerColor(2);
grb->SetMarkerStyle(20);
grb->SetMarkerSize(2);
grb->SetLineColor(2.);
grb->SetLineWidth(2.);
grb->Draw(“P”);

gStyle->SetEndErrorSize(4);
Int_t nBELGGSZ = 2;
Float_t XplusBELGGSZ[nBELGGSZ] = {0.105, 0.024};
Float_t yBELGGSZ[nBELGGSZ] = {0.25,1.25};
// create the error arrays
Float_t eStatXplusBELGGSZ[nBELGGSZ] = {0.047, 0.140};
Float_t eTotXplusBELGGSZ[nBELGGSZ];
Float_t eSystXplusBELGGSZ[nBELGGSZ] = {0.011, 0.018};
Float_t eyBELGGSZ[nBELGGSZ] = {0.,0.};
for (Int_t i=0; i<nBELGGSZ; i++)
{
eTotXplusBELGGSZ[i] = sqrt(eStatXplusBELGGSZ[i]*eStatXplusBELGGSZ[i]+eSystXplusBELGGSZ[i]*eSystXplusBELGGSZ[i]);
}
gr = new TGraphAsymmErrors(nBELGGSZ,XplusBELGGSZ,yBELGGSZ,eStatXplusBELGGSZ,eStatXplusBELGGSZ,eyBELGGSZ,eyBELGGSZ);
gr->SetMarkerColor(4);
gr->SetMarkerStyle(20);
gr->SetMarkerSize(2);
gr->SetLineColor(4.);
gr->SetLineWidth(2.);
gr->Draw(“P”);
grb = new TGraphAsymmErrors(nBELGGSZ,XplusBELGGSZ,yBELGGSZ,eTotXplusBELGGSZ,eTotXplusBELGGSZ,eyBELGGSZ,eyBELGGSZ);
grb->SetMarkerColor(4);
grb->SetMarkerStyle(20);
grb->SetMarkerSize(2);
grb->SetLineColor(4.);
grb->SetLineWidth(2.);
grb->Draw(“P”);

TGaxis *axis_x1 = new TGaxis(xmin,ymin,xmax,ymin,xmin,xmax,510);
axis_x1->SetLabelOffset(10.04);axis_x1->Draw();
TGaxis *axis_x2 = new TGaxis(xmin,ymax,xmax,ymax,xmin,xmax,510,"-");
axis_x2->SetLabelOffset(10.04);axis_x2->Draw();

c1->SaveAs(“Xminus.pdf”);

}
[/code]

with R5.18 or 5.20 I get respectively:
lappweb.in2p3.fr/babar/people/Vi … s-5.18.gif

and

lappweb.in2p3.fr/babar/people/Vi … s-5.20.gif

I suspect I am doing something not orthodox with

[code] Int_t ncx=100;
Int_t ncy=100;
Double_t xmin=-0.4;
Double_t ymin=0.;
Double_t xmax=0.6;
Double_t ymax=3.;
TCanvas *c1 = new TCanvas (“c1”,"XMinus ",200,10,400,600);
c1->cd();

TH2F* frame = new TH2F(“frame”,"",ncx,xmin,xmax,ncy,ymin,ymax);

frame->SetYTitle(" “);
frame->GetXaxis()->CenterTitle();
frame->SetXTitle(” ");
frame->SetLabelOffset(10.0,“y”);
frame->Draw(“same”);
[/code]

to define my frame

Thanks for help

regards
Vincent

I’ll look. Note that when you have such a long script it is better to put it as an attachment.

Thanks a lot Olivier
and sorry for the long post

Hi Vincent,

All you Draw command are with option “same”, therefore the space coordinates are never define. The first Draw() should not have the option “same” . Do:

frame->Draw();

Olivier

OK This was it : thanks a lot Olivier
but for a reason that I ignore this was fine in ROOT 5.18

I have no idea why it worked with 5.18. It should not. All your plots used the option “same” it could not work. May be the macro was changed in between ? may be you used it in an other context and some coordinate space was defined ?