From 767c83cf3871de14a142f80af445ca87987e647d Mon Sep 17 00:00:00 2001 From: Nick Tremaroli Date: Tue, 3 Sep 2024 14:16:18 +0200 Subject: [PATCH] Fixed bug displaying data offline --- .../plotter/matplotlib_viewer_canvas.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/robot_log_visualizer/plotter/matplotlib_viewer_canvas.py b/robot_log_visualizer/plotter/matplotlib_viewer_canvas.py index b577b69..5e4986f 100644 --- a/robot_log_visualizer/plotter/matplotlib_viewer_canvas.py +++ b/robot_log_visualizer/plotter/matplotlib_viewer_canvas.py @@ -186,9 +186,8 @@ def on_pick(self, event): ) def update_plots(self, paths, legends, realtime_plot): - if realtime_plot: - self.axes.cla() - realtimeColorIndex = 0 + self.axes.cla() + colorIndex = 0 for path, legend in zip(paths, legends): path_string = "/".join(path) legend_string = "/".join(legend[1:]) @@ -210,17 +209,18 @@ def update_plots(self, paths, legends, realtime_plot): datapoints, label=legend_string, picker=True, - color=self.color_palette.get_color(realtimeColorIndex), + color=self.color_palette.get_color(colorIndex), ) - realtimeColorIndex = realtimeColorIndex + 1 + colorIndex = colorIndex + 1 else: (self.active_paths[path_string],) = self.axes.plot( timestamps, datapoints, label=legend_string, picker=True, - color=next(self.color_palette), + color=self.color_palette.get_color(colorIndex), ) + colorIndex = colorIndex + 1 paths_to_be_canceled = []