File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Framework/Core/include/Framework Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -124,11 +124,14 @@ struct AxisSpec {
124124 }
125125
126126 const double min = binEdges[0 ];
127- const double width = (binEdges[1 ] - binEdges[0 ]) / nBins.value ();
128- binEdges.clear ();
129- binEdges.resize (0 );
130- for (int i = 0 ; i < nBins.value () + 1 ; i++) {
131- binEdges.push_back (std::pow (10 ., min + i * width));
127+ const double max = binEdges[1 ];
128+ const double logmin = std::log10 (min);
129+ const double logmax = std::log10 (max);
130+ const int nbins = nBins.value ();
131+ const double logdelta = (logmax - logmin) / (static_cast <double >(nbins));
132+ const double log10 = std::log10 (10 .);
133+ for (int i = 0 ; i < nbins + 1 ; i++) {
134+ binEdges.push_back (std::exp (log10 * (logmin + i * logdelta)));
132135 }
133136 nBins = std::nullopt ;
134137 }
You can’t perform that action at this time.
0 commit comments