Skip to content

Commit d087f00

Browse files
couetosschar
authored andcommitted
Computation of fHistogram limits were different in Paint and GetHistogram (root-project#5578)
1 parent 2cc045f commit d087f00

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hist/hist/src/TMultiGraph.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,14 @@ TH1F *TMultiGraph::GetHistogram()
10781078
}
10791079
if (g->GetN() > npt) npt = g->GetN();
10801080
}
1081+
if (rwxmin == rwxmax) rwxmax += 1.;
1082+
if (rwymin == rwymax) rwymax += 1.;
1083+
double dx = 0.05*(rwxmax-rwxmin);
1084+
double dy = 0.05*(rwymax-rwymin);
1085+
rwxmin = rwxmin - dx;
1086+
rwxmax = rwxmax + dx;
1087+
rwymin = rwymin - dy;
1088+
rwymax = rwymax + dy;
10811089
fHistogram = new TH1F(GetName(),GetTitle(),npt,rwxmin,rwxmax);
10821090
if (!fHistogram) return 0;
10831091
fHistogram->SetMinimum(rwymin);

0 commit comments

Comments
 (0)