diff --git a/src/View/Results/PlotH.py b/src/View/Results/PlotH.py index 3dfe2466f623707b0c023a7f4c667ca29af2362a..22abb87f976fb025daa332ca1b582e5261449f30 100644 --- a/src/View/Results/PlotH.py +++ b/src/View/Results/PlotH.py @@ -88,20 +88,21 @@ class PlotH(PamhyrPlot): if len(self._current_res_id) < 1: return + if len(self._current_res_id) == 1: + self.draw_max(self._current_res_id[0]) + for res_id in self._current_res_id: if self.results[res_id] is None: continue results = self.results[res_id] reach = results.river.reach(self._current_reach_id) - profile = reach.profile(self._current_profile_id) if reach.geometry.number_profiles == 0: self._init = False return - self.draw_max(reach) - self.draw_data(reach, profile) + self.draw_data(res_id) self.canvas.axes.set_xlabel( self._trad["unit_time_s"], @@ -122,15 +123,28 @@ class PlotH(PamhyrPlot): self.draw_current() self._init = True - def draw_data(self, reach, profile): + def draw_data(self, res_id): + + results = self.results[res_id] + reach = results.river.reach(self._current_reach_id) + profile = reach.profile(self._current_profile_id) x = self._timestamps y = profile.get_key("Q") + if res_id == 2: + label = "Δ " + self.label_discharge + else: + label = self.label_discharge + + if len(self._current_res_id) > 1: + if res_id != 2: + label += f" ({results._solver.name})" + line, = self.canvas.axes.plot( x, y, - label=self.label_discharge, - color=self.color_plot, + label=label, + color=self.colors[res_id + 1], **self.plot_default_kargs ) self._line.append(line) @@ -145,10 +159,23 @@ class PlotH(PamhyrPlot): lw=1., ) - def draw_max(self, reach): + def draw_max(self, res_id): + results = self.results[res_id] + reach = results.river.reach(self._current_reach_id) + profile = reach.profile(self._current_profile_id) + + if reach.geometry.number_profiles == 0: + self._init = False + return x = self._timestamps y = [] + + if res_id == 2: + label = "Δ " + self.label_discharge_max + else: + label = self.label_discharge_max + for ts in x: ts_y = -9999 for profile in reach.profiles: @@ -158,7 +185,7 @@ class PlotH(PamhyrPlot): m, = self.canvas.axes.plot( x, y, - label=self.label_discharge_max, + label=label, color=self.color_plot_highlight, linestyle='dotted', **self.plot_default_kargs