From b47c0d8709327ff2a95a88020521fff005b37878 Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Thu, 14 Dec 2023 13:34:32 +0100 Subject: [PATCH] Fixing percentiles --- src/visualisers/EpsGraph.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/visualisers/EpsGraph.cc b/src/visualisers/EpsGraph.cc index 1998281f..5569c45c 100644 --- a/src/visualisers/EpsGraph.cc +++ b/src/visualisers/EpsGraph.cc @@ -2589,15 +2589,18 @@ void EpsPlume::timeserie(Data& data, BasicGraphicsObjectContainer& visitor) { } if (shading_) { for (vector::iterator level = shading_levels_.begin(); level != shading_levels_.end(); ++level) { - int i = *level * (members.size()/100.); + int i = (*level/100) * members.size(); + if (i >= members.size()) i = members.size() - 1; + + shading[*level].push_back(PaperPoint(x, members[i])); } } if (percentiles_) { for (vector::iterator level = percentiles_list_.begin(); level != percentiles_list_.end(); ++level) { - int i = *level * (members.size()/100.); + int i = (*level/100) * members.size(); if (i >= members.size()) i = members.size() - 1; percentiles[*level].push_back(PaperPoint(x, members[i]));