From ab11d15729f9071f5119988439f1ee59e3ccd6d0 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr> Date: Fri, 3 May 2024 15:01:03 +0200 Subject: [PATCH] Results: Plot: Fix display whene more than 10 sl. --- src/View/Results/PlotKPC.py | 7 +++++-- src/View/Tools/PamhyrPlot.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/View/Results/PlotKPC.py b/src/View/Results/PlotKPC.py index 1cab022e..71fa3aab 100644 --- a/src/View/Results/PlotKPC.py +++ b/src/View/Results/PlotKPC.py @@ -119,11 +119,14 @@ class PlotKPC(PamhyrPlot): self.line_kp_sl.append(None) self.line_kp_sl[i], = self.canvas.axes.plot( kp, z, - linestyle="solid" if i == len(final_z_sl) - 1 else "--", + linestyle=( + "solid" if i == len(final_z_sl) - 1 + else self.linestyle[1:][i // len(self.colors)] + ), lw=1., color=( self.color_plot_river_bottom if i == len(final_z_sl) - 1 - else self.colors[i] + else self.colors[i % len(self.colors)] ) ) diff --git a/src/View/Tools/PamhyrPlot.py b/src/View/Tools/PamhyrPlot.py index 59883f6e..c544c97e 100644 --- a/src/View/Tools/PamhyrPlot.py +++ b/src/View/Tools/PamhyrPlot.py @@ -40,7 +40,7 @@ class PamhyrPlot(APlot): color_plot_river_water_zone = "skyblue" colors = list(mplcolors.TABLEAU_COLORS) - linestyle = ['solid', 'dotted', 'dashed', 'dashdot'] + linestyle = ['solid', 'dashed', 'dashdot', 'dotted'] plot_default_kargs = { "lw": 1., -- GitLab