12 TH2F* hnew =
new TH2F(
"hnew",
"", x_nbins, x_min, x_max, y_nbins, y_min, y_max );
13 TAxis *xaxis = hnew->GetXaxis();
14 TAxis *yaxis = hnew->GetYaxis();
15 int xbins = xaxis->GetNbins();
16 int ybins = yaxis->GetNbins();
18 Axis_t
xmin = xaxis->GetXmin();
19 Axis_t
xmax = xaxis->GetXmax();
20 Axis_t xwidth = (xmax -
xmin ) / xbins;
21 Axis_t *new_xbins =
new Axis_t[xbins + 1];
23 Axis_t
ymin = yaxis->GetXmin();
24 Axis_t
ymax = yaxis->GetXmax();
25 Axis_t ywidth = (ymax -
ymin) / ybins;
26 Axis_t *new_ybins =
new Axis_t[ybins + 1];
28 for(
int i =0;
i <= xbins;
i++)
30 new_xbins[
i] = TMath::Power( 10, xmin +
i*xwidth);
32 xaxis->Set(xbins, new_xbins);
34 for(
int i =0;
i <= ybins;
i++)
36 new_ybins[
i] = TMath::Power( 10, ymin +
i*ywidth);
38 yaxis->Set(ybins, new_ybins);