@@ -1438,7 +1438,7 @@ TH1F *TGraph::GetHistogram() const
14381438 // therefore they might be too strict and cut some points. In that case the
14391439 // fHistogram limits should be recomputed ie: the existing fHistogram
14401440 // should not be returned.
1441- TH1F *historg = nullptr ;
1441+ TH1F *histogr = nullptr ;
14421442 if (fHistogram ) {
14431443 if (!TestBit (kResetHisto )) {
14441444 if (gPad && gPad ->GetLogx ()) {
@@ -1451,7 +1451,7 @@ TH1F *TGraph::GetHistogram() const
14511451 } else {
14521452 const_cast <TGraph*>(this )->ResetBit (kResetHisto );
14531453 }
1454- historg = fHistogram ;
1454+ histogr = fHistogram ;
14551455 }
14561456
14571457 if (rwxmin == rwxmax) rwxmax += 1 .;
@@ -1492,7 +1492,7 @@ TH1F *TGraph::GetHistogram() const
14921492 const char *gname = GetName ();
14931493 if (!gname[0 ]) gname = " Graph" ;
14941494 // do not add the histogram to gDirectory
1495- // use local TDirectory::TContect that will set temporarly gDirectory to a nullptr and
1495+ // use local TDirectory::TContext that will set temporarly gDirectory to a nullptr and
14961496 // will avoid that histogram is added in the global directory
14971497 {
14981498 TDirectory::TContext ctx (nullptr );
@@ -1504,24 +1504,24 @@ TH1F *TGraph::GetHistogram() const
15041504 fHistogram ->SetMaximum (maximum);
15051505 fHistogram ->GetYaxis ()->SetLimits (minimum, maximum);
15061506 // Restore the axis attributes if needed
1507- if (historg ) {
1508- fHistogram ->GetXaxis ()->SetTitle (historg ->GetXaxis ()->GetTitle ());
1509- fHistogram ->GetXaxis ()->CenterTitle (historg ->GetXaxis ()->GetCenterTitle ());
1510- fHistogram ->GetXaxis ()->RotateTitle (historg ->GetXaxis ()->GetRotateTitle ());
1511- fHistogram ->GetXaxis ()->SetNoExponent (historg ->GetXaxis ()->GetNoExponent ());
1512- fHistogram ->GetXaxis ()->SetTimeDisplay (historg ->GetXaxis ()->GetTimeDisplay ());
1513- fHistogram ->GetXaxis ()->SetTimeFormat (historg ->GetXaxis ()->GetTimeFormat ());
1514- historg ->GetXaxis ()->TAttAxis ::Copy (*(fHistogram ->GetXaxis ()));
1515-
1516- fHistogram ->GetYaxis ()->SetTitle (historg ->GetYaxis ()->GetTitle ());
1517- fHistogram ->GetYaxis ()->CenterTitle (historg ->GetYaxis ()->GetCenterTitle ());
1518- fHistogram ->GetYaxis ()->RotateTitle (historg ->GetYaxis ()->GetRotateTitle ());
1519- fHistogram ->GetYaxis ()->SetNoExponent (historg ->GetYaxis ()->GetNoExponent ());
1520- fHistogram ->GetYaxis ()->SetTimeDisplay (historg ->GetYaxis ()->GetTimeDisplay ());
1521- fHistogram ->GetYaxis ()->SetTimeFormat (historg ->GetYaxis ()->GetTimeFormat ());
1522- historg ->GetYaxis ()->TAttAxis ::Copy (*(fHistogram ->GetYaxis ()));
1523-
1524- delete historg ;
1507+ if (histogr ) {
1508+ fHistogram ->GetXaxis ()->SetTitle (histogr ->GetXaxis ()->GetTitle ());
1509+ fHistogram ->GetXaxis ()->CenterTitle (histogr ->GetXaxis ()->GetCenterTitle ());
1510+ fHistogram ->GetXaxis ()->RotateTitle (histogr ->GetXaxis ()->GetRotateTitle ());
1511+ fHistogram ->GetXaxis ()->SetNoExponent (histogr ->GetXaxis ()->GetNoExponent ());
1512+ fHistogram ->GetXaxis ()->SetTimeDisplay (histogr ->GetXaxis ()->GetTimeDisplay ());
1513+ fHistogram ->GetXaxis ()->SetTimeFormat (histogr ->GetXaxis ()->GetTimeFormat ());
1514+ histogr ->GetXaxis ()->TAttAxis ::Copy (*(fHistogram ->GetXaxis ()));
1515+
1516+ fHistogram ->GetYaxis ()->SetTitle (histogr ->GetYaxis ()->GetTitle ());
1517+ fHistogram ->GetYaxis ()->CenterTitle (histogr ->GetYaxis ()->GetCenterTitle ());
1518+ fHistogram ->GetYaxis ()->RotateTitle (histogr ->GetYaxis ()->GetRotateTitle ());
1519+ fHistogram ->GetYaxis ()->SetNoExponent (histogr ->GetYaxis ()->GetNoExponent ());
1520+ fHistogram ->GetYaxis ()->SetTimeDisplay (histogr ->GetYaxis ()->GetTimeDisplay ());
1521+ fHistogram ->GetYaxis ()->SetTimeFormat (histogr ->GetYaxis ()->GetTimeFormat ());
1522+ histogr ->GetYaxis ()->TAttAxis ::Copy (*(fHistogram ->GetYaxis ()));
1523+
1524+ delete histogr ;
15251525 }
15261526 return fHistogram ;
15271527}
0 commit comments