#4571 Sum. cmd. line: Add support for -s, -n and -e to grid cell plotting

This commit is contained in:
Jacob Støren
2019-08-22 08:34:49 +02:00
committed by Gaute Lindkvist
parent 889577400a
commit 11e73a76fc
4 changed files with 114 additions and 21 deletions

View File

@@ -214,6 +214,22 @@ std::vector<double> RimGridTimeHistoryCurve::yValues() const
}
}
RimSummaryPlot* plot = nullptr;
firstAncestorOrThisOfTypeAsserted(plot);
bool isNormalized = plot->isNormalizationEnabled();
if (isNormalized)
{
auto minMaxPair = std::minmax_element(values.begin(), values.end());
double min = *minMaxPair.first;
double max = *minMaxPair.second;
double range = max - min;
for (double & v: values)
{
v = (v - min)/range;
}
}
return values;
}