diff --git a/src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc b/src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc index ac52048..d34a4c1 100644 --- a/src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc +++ b/src/ParamOutputImpl/Plot/HistoPlot/Histo1DFunction.cc @@ -37,14 +37,17 @@ void Histo1DFunction::apply(std::shared_ptr functionToApply, st double& xBinSize, bool yIsLog, double& yMin, double& yMax) { bool yMaxToModify=true; + bool yMinToModify=true; if(!_cacheGrid.empty()){ grid = _cacheGrid; return; } if(std::isnan(yMin)) yMin = (yIsLog) ? 1 : 0; + else + yMinToModify = false; if(std::isnan(yMax)) - yMax = 0; + yMax = (yIsLog) ? 1 : 0; else yMaxToModify = false; std::map> allValues; @@ -55,15 +58,26 @@ void Histo1DFunction::apply(std::shared_ptr functionToApply, st functionToApply->calculate(grid, allValues, xRange, xBinSize, yIsLog); - if(yMaxToModify) + if(yMaxToModify){ for(auto cell:grid){ if(yMax < cell.second) yMax = cell.second; + } + if(yIsLog) + yMax = exp10(yMax); + } + + if(yMinToModify){ + for(auto cell:grid){ if(yMin > cell.second) yMin = cell.second; } - if(yIsLog) - yMin = log10(yMin); + if(yIsLog) + yMin = exp10(yMin); + } + + + } // Density function for 1DHistogram -- libgit2 0.21.2