From 57a80d00aa09d05ef9e278bc83fcd8f530409915 Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Tue, 21 Oct 2025 15:01:16 +0200 Subject: [PATCH 1/6] work on import data in results --- src/View/Results/Window.py | 36 +++++++++++++++++++++++++++++++++-- src/View/Results/translate.py | 2 ++ src/View/ui/Results.ui | 13 +++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 9238c1bc..b88f8f87 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -337,7 +337,8 @@ class ResultsWindow(PamhyrWindow): "action_add": self._add_custom_plot, "action_export": self._export, # "action_export": self.export_current, - "action_Geo_tiff": self.import_geotiff + "action_Geo_tiff": self.import_geotiff, + "action_import_data": self.import_data } self.find(QAction, "action_Geo_tiff").setEnabled(False) self.find(QAction, "action_Geo_tiff").setVisible(False) @@ -703,7 +704,7 @@ class ResultsWindow(PamhyrWindow): select_file="AnyFile", callback=lambda f: self.export_to(f[0], x, y, envelop, solver_id), default_suffix=".csv", - file_filter=["CSV (*.csv)"], + file_filter=[self._dict["file_csv"]], ) def export_to(self, filename, x, y, envelop, solver_id): @@ -1214,3 +1215,34 @@ class ResultsWindow(PamhyrWindow): # self.canvas.axes.set_xlim(xlim) # self.canvas.axes.set_ylim(ylim) return + + def import_data(self): + + file_types = [ + self._trad["file_csv"], + self._trad["file_all"], + ] + + self.file_dialog( + select_file="Existing_file", + callback=lambda f: self.read_csv_file(f[0]), + default_suffix=".csv", + file_filter=file_types, + ) + + def read_csv_file(self, filename): + with open(filename, 'r', newline='') as f: + lines=f.readlines() + x = [] + y = [] + for line in lines: + if line[0] != "*" and line[0] != "#" and line[0] != "$": + row = line.split(" ") + print(row) + if len(row) > 1: + x.append(float(row[0])) + y.append(float(row[1])) + print(x) + print(y) + self.canvas_2.axes.scatter(x, y, marker="+") + self.plot_rkc.idle() diff --git a/src/View/Results/translate.py b/src/View/Results/translate.py index cd6f46d4..7a1e7e9b 100644 --- a/src/View/Results/translate.py +++ b/src/View/Results/translate.py @@ -56,6 +56,8 @@ class ResultsTranslate(MainTranslate): self._dict["file_all"] = _translate("Results", "All files (*)") self._dict["file_geotiff"] = _translate( "Results", "GeoTIFF file (*.tiff *.tif)") + self._dict["file_csv"] = _translate( + "Results", "CSV file (*.csv)") self._dict["ImageCoordinates"] = _translate( "Results", "Image coordinates" ) diff --git a/src/View/ui/Results.ui b/src/View/ui/Results.ui index 3fcf700a..4e33b042 100644 --- a/src/View/ui/Results.ui +++ b/src/View/ui/Results.ui @@ -239,6 +239,7 @@ + @@ -288,6 +289,18 @@ Import background image + + + + ressources/import.pngressources/import.png + + + Import data + + + Import data from SCV file + + From bf95b7f7e6dfbf3b40e2f6c41aa8ea57dc440b91 Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Wed, 22 Oct 2025 16:12:27 +0200 Subject: [PATCH 2/6] work on import data in result window --- src/View/Results/Window.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index b88f8f87..49f3af0c 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -44,7 +44,7 @@ from PyQt5.QtWidgets import ( QFileDialog, QTableView, QAbstractItemView, QUndoStack, QShortcut, QAction, QItemDelegate, QComboBox, QVBoxLayout, QHeaderView, QTabWidget, - QSlider, QLabel, QWidget, QGridLayout, QTabBar + QSlider, QLabel, QWidget, QGridLayout, QTabBar, QInputDialog ) from View.Tools.Plot.PamhyrCanvas import MplCanvas @@ -1231,6 +1231,9 @@ class ResultsWindow(PamhyrWindow): ) def read_csv_file(self, filename): + if filename == "": + return + with open(filename, 'r', newline='') as f: lines=f.readlines() x = [] @@ -1242,7 +1245,18 @@ class ResultsWindow(PamhyrWindow): if len(row) > 1: x.append(float(row[0])) y.append(float(row[1])) + data_type_lst =['Q(t)', 'Z(x)'] + data_type, ok = QInputDialog.getItem( + self, 'Data type', 'Chose the type of data:', data_type_lst) + + if not ok: + return + print(x) print(y) - self.canvas_2.axes.scatter(x, y, marker="+") - self.plot_rkc.idle() + if data_type == 'Z(x)': + self.canvas_2.axes.scatter(x, y, marker="+") + self.plot_rkc.idle() + if data_type == 'Q(t)': + self.canvas_4.axes.scatter(x, y, marker="+") + self.plot_h.idle() From 990d44dd0721f6685f26524f42eb9921fce5a32d Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Thu, 23 Oct 2025 14:50:06 +0200 Subject: [PATCH 3/6] again --- src/View/Results/Table.py | 2 -- src/View/Results/Window.py | 38 ++++++++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/View/Results/Table.py b/src/View/Results/Table.py index a219c49b..668619f0 100644 --- a/src/View/Results/Table.py +++ b/src/View/Results/Table.py @@ -160,8 +160,6 @@ class TableModel(PamhyrTableModel): self._lst = _river.reachs elif self._opt_data == "profile" or self._opt_data == "raw_data": self._lst = _river.reach(reach).profiles - # self._lst = list(compress(_river.reach(reach).profiles, - # _river.reach(reach).profile_mask)) elif self._opt_data == "solver": self._lst = self._parent._solvers diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 49f3af0c..6e906888 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -1234,29 +1234,51 @@ class ResultsWindow(PamhyrWindow): if filename == "": return + sep = " " with open(filename, 'r', newline='') as f: - lines=f.readlines() + lines = f.readlines() x = [] y = [] for line in lines: if line[0] != "*" and line[0] != "#" and line[0] != "$": - row = line.split(" ") + row = line.split(sep) print(row) - if len(row) > 1: - x.append(float(row[0])) - y.append(float(row[1])) - data_type_lst =['Q(t)', 'Z(x)'] + if len(row) >= 2: + try: + x.append(float(row[0])) + y.append(float(row[1])) + except: + pass + print(x) + print(y) + + # with open(filename, 'r', newline='') as f: + # reader = csv.reader(f, delimiter=sep, quotechar='|', + # quoting=csv.QUOTE_NONNUMERIC) + # for row in reader: + # print(row) + # if len(row) == 2: + # x.append(float(row[0])) + # y.append(float(row[1])) + + data_type_lst = ['Q(t)', 'Z(t)', 'Z(x)'] data_type, ok = QInputDialog.getItem( self, 'Data type', 'Chose the type of data:', data_type_lst) if not ok: return - print(x) - print(y) if data_type == 'Z(x)': self.canvas_2.axes.scatter(x, y, marker="+") self.plot_rkc.idle() if data_type == 'Q(t)': self.canvas_4.axes.scatter(x, y, marker="+") self.plot_h.idle() + if data_type == 'Z(t)': + for plot in self._additional_plot: + x_key = plot.split(": ")[0] + y_key = plot.split(": ")[1].split(",") + if 'time' in x_key and 'water_elevation' in y_key: + self._additional_plot[plot].canvas.axes.scatter( + x, y, marker="+") + self._additional_plot[plot].idle() From 68b62a5630ea0bf9864d44ca203d465485d4ae41 Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Thu, 23 Oct 2025 15:30:41 +0200 Subject: [PATCH 4/6] debug water limits --- src/Model/Geometry/ProfileXYZ.py | 78 ++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/src/Model/Geometry/ProfileXYZ.py b/src/Model/Geometry/ProfileXYZ.py index 82ef682c..fe517fe6 100644 --- a/src/Model/Geometry/ProfileXYZ.py +++ b/src/Model/Geometry/ProfileXYZ.py @@ -749,8 +749,8 @@ class ProfileXYZ(Profile, SQLSubModel): if zz[i] >= z and zz[i+1] < z: y = np.interp( z, - [zz[i], zz[i+1]], - [station[i], station[i+1]] + [zz[i+1], zz[i]], + [station[i+1], station[i]] ) line.append([y, z]) @@ -839,11 +839,13 @@ class ProfileXYZ(Profile, SQLSubModel): for i in range(self.number_points-1): if zz[i] > z and zz[i+1] <= z: - y = np.interp( - z, - [zz[i], zz[i+1]], - [station[i], station[i+1]] - ) + fact = (z - zz[i]) / (zz[i+1] - zz[i]) + y = station[i] + fact * (station[i+1] - station[i]) + #y = np.interp( + #z, + #[zz[i+1], zz[i]], + #[station[i+1], station[i]] + #) start.append(y) end = [] @@ -852,11 +854,13 @@ class ProfileXYZ(Profile, SQLSubModel): for i in reversed(range(self.number_points-1)): if zz[i] <= z and zz[i+1] > z: - y = np.interp( - z, - [zz[i], zz[i+1]], - [station[i], station[i+1]] - ) + fact = (z - zz[i]) / (zz[i+1] - zz[i]) + y = station[i] + fact * (station[i+1] - station[i]) + #y = np.interp( + #z, + #[zz[i], zz[i+1]], + #[station[i], station[i+1]] + #) end.append(y) if len(start) != len(end): @@ -887,33 +891,39 @@ class ProfileXYZ(Profile, SQLSubModel): # Interpolate points at river left side if (i_left > 0): - x = np.interp( - z, - [self.point(i_left).z, self.point(i_left - 1).z], - [self.point(i_left).x, self.point(i_left - 1).x] - ) - y = np.interp( - z, - [self.point(i_left).z, self.point(i_left - 1).z], - [self.point(i_left).y, self.point(i_left - 1).y] - ) - pt_left = PointXYZ(x, y, z, name="wl_left") + fact = (z - self.point(i_left).z) / (self.point(i_left - 1).z - self.point(i_left).z) + x = self.point(i_left).x + fact * (self.point(i_left - 1).x - self.point(i_left).x) + y = self.point(i_left).y + fact * (self.point(i_left - 1).y - self.point(i_left).y) + #x = np.interp( + #z, + #[self.point(i_left - 1).z, self.point(i_left).z], + #[self.point(i_left - 1).x, self.point(i_left).x] + #) + #y = np.interp( + #z, + #[self.point(i_left).z, self.point(i_left - 1).z], + #[self.point(i_left).y, self.point(i_left - 1).y] + #) + pt_left = PointXYZ(x=x, y=y, z=z, name="wl_left") else: pt_left = self.point(0) # Interpolate points at river right side if (i_right < self.number_points - 1): - x = np.interp( - z, - [self.point(i_right).z, self.point(i_right + 1).z], - [self.point(i_right).x, self.point(i_right + 1).x] - ) - y = np.interp( - z, - [self.point(i_right).z, self.point(i_right + 1).z], - [self.point(i_right).y, self.point(i_right + 1).y] - ) - pt_right = PointXYZ(x, y, z, name="wl_right") + fact = (z - self.point(i_right).z) / (self.point(i_right + 1).z - self.point(i_right).z) + x = self.point(i_right).x + fact * (self.point(i_right + 1).x - self.point(i_right).x) + y = self.point(i_right).y + fact * (self.point(i_right + 1).y - self.point(i_right).y) + #x = np.interp( + #z, + #[self.point(i_right).z, self.point(i_right + 1).z], + #[self.point(i_right).x, self.point(i_right + 1).x] + #) + #y = np.interp( + #z, + #[self.point(i_right).z, self.point(i_right + 1).z], + #[self.point(i_right).y, self.point(i_right + 1).y] + #) + pt_right = PointXYZ(x=x, y=y, z=z, name="wl_right") else: pt_right = self.point(self.number_points - 1) From 84486c03ed3ec718051ab030a3c1b0712f866e8a Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Fri, 24 Oct 2025 15:11:11 +0200 Subject: [PATCH 5/6] more work on import data results --- src/View/Results/CustomPlot/Plot.py | 25 +++++------ src/View/Results/CustomPlot/Translate.py | 3 ++ src/View/Results/Window.py | 53 ++++++++++++++++++------ 3 files changed, 55 insertions(+), 26 deletions(-) diff --git a/src/View/Results/CustomPlot/Plot.py b/src/View/Results/CustomPlot/Plot.py index 64e09f66..c1240939 100644 --- a/src/View/Results/CustomPlot/Plot.py +++ b/src/View/Results/CustomPlot/Plot.py @@ -599,13 +599,7 @@ class CustomPlot(PamhyrPlot): self.lines["wet_area"] = line # Legend - lns = reduce( - lambda acc, line: acc + line, - map(lambda line: self.lines[line], self.lines), - [] - ) - labs = list(map(lambda line: self._trad[line], self.lines)) - self.canvas.axes.legend(lns, labs, loc="best") + self.update_legend() def _redraw_rk(self): results = self.data[self._current_res_id] @@ -1103,13 +1097,7 @@ class CustomPlot(PamhyrPlot): self._customize_x_axes_time(ts) # Legend - lns = reduce( - lambda acc, line: acc + line, - map(lambda line: self.lines[line], self.lines), - [] - ) - labs = list(map(lambda line: self._trad[line], self.lines)) - self.canvas.axes.legend(lns, labs, loc="best") + self.update_legend() def _redraw_time(self): @@ -1419,3 +1407,12 @@ class CustomPlot(PamhyrPlot): x = self._timestamp self._current.set_data([x, x], self.canvas.axes.get_ylim()) self.canvas.draw_idle() + + def update_legend(self): + lns = reduce( + lambda acc, line: acc + line, + map(lambda line: self.lines[line], self.lines), + [] + ) + labs = list(map(lambda line: self._trad[line], self.lines)) + self.canvas.axes.legend(lns, labs, loc="best") diff --git a/src/View/Results/CustomPlot/Translate.py b/src/View/Results/CustomPlot/Translate.py index d341732f..a6edcff7 100644 --- a/src/View/Results/CustomPlot/Translate.py +++ b/src/View/Results/CustomPlot/Translate.py @@ -55,6 +55,9 @@ class CustomPlotTranslate(ResultsTranslate): self._dict['wet_perimeter'] = self._dict["unit_wet_perimeter"] self._dict['hydraulic_radius'] = self._dict["unit_hydraulic_radius"] self._dict['froude'] = self._dict["unit_froude"] + self._dict['user_imported'] = _translate( + "CustomPlot", "user_imported" + ) # Unit corresponding long name (plot axes display) diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 6e906888..0ef2cbc5 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -19,6 +19,7 @@ import os import csv import logging +from functools import reduce # import rasterio from numpy import sqrt @@ -1268,17 +1269,45 @@ class ResultsWindow(PamhyrWindow): if not ok: return + legend, ok = QInputDialog.getText( + self, 'Legend','Legend:' ) + + if not ok: + return + + if legend.strip() == '': + legend = '*' + + tmp_dict = {'Z': 'water_elevation', + 'Q': 'discharge', + 'x': 'rk', + 't': 'time'} + + tmp_unit = {'Z': ' (m)', + 'Q': ' (m³/s)'} + if data_type == 'Z(x)': - self.canvas_2.axes.scatter(x, y, marker="+") - self.plot_rkc.idle() + line = self.canvas_2.axes.plot(x, y, marker="+", + label = legend + ' (m)') + self.plot_rkc.canvas.draw_idle() + self.plot_rkc.update_idle() if data_type == 'Q(t)': - self.canvas_4.axes.scatter(x, y, marker="+") - self.plot_h.idle() - if data_type == 'Z(t)': - for plot in self._additional_plot: - x_key = plot.split(": ")[0] - y_key = plot.split(": ")[1].split(",") - if 'time' in x_key and 'water_elevation' in y_key: - self._additional_plot[plot].canvas.axes.scatter( - x, y, marker="+") - self._additional_plot[plot].idle() + line = self.canvas_4.axes.plot(x, y, + marker="+", + label = legend + ' (m³/s)') + self.plot_h._line.append(line) + self.plot_h.enable_legend() + for p in self._additional_plot: + plot = self._additional_plot[p] + x_key = p.split(": ")[0] + y_key = p.split(": ")[1].split(",") + if (tmp_dict[data_type[2]] in x_key and + tmp_dict[data_type[0]] in y_key): + while legend in plot.lines: + legend += '*' + plot._trad._dict[legend] = legend + tmp_unit[data_type[0]] + plot.lines[legend] = plot.canvas.axes.plot(x, y, + marker="+", + linestyle="--") + plot.update_legend() + plot.idle() From e6dd983f97d2a4fed3180938d752d7d5aa3121aa Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Fri, 24 Oct 2025 16:36:06 +0200 Subject: [PATCH 6/6] more work on compare results --- src/Model/Geometry/ProfileXYZ.py | 48 ++++++++--------------------- src/View/Results/CustomPlot/Plot.py | 13 ++++++++ src/View/Results/Window.py | 46 +++++++++------------------ 3 files changed, 40 insertions(+), 67 deletions(-) diff --git a/src/Model/Geometry/ProfileXYZ.py b/src/Model/Geometry/ProfileXYZ.py index fe517fe6..41381a04 100644 --- a/src/Model/Geometry/ProfileXYZ.py +++ b/src/Model/Geometry/ProfileXYZ.py @@ -841,11 +841,6 @@ class ProfileXYZ(Profile, SQLSubModel): if zz[i] > z and zz[i+1] <= z: fact = (z - zz[i]) / (zz[i+1] - zz[i]) y = station[i] + fact * (station[i+1] - station[i]) - #y = np.interp( - #z, - #[zz[i+1], zz[i]], - #[station[i+1], station[i]] - #) start.append(y) end = [] @@ -856,11 +851,6 @@ class ProfileXYZ(Profile, SQLSubModel): if zz[i] <= z and zz[i+1] > z: fact = (z - zz[i]) / (zz[i+1] - zz[i]) y = station[i] + fact * (station[i+1] - station[i]) - #y = np.interp( - #z, - #[zz[i], zz[i+1]], - #[station[i], station[i+1]] - #) end.append(y) if len(start) != len(end): @@ -891,38 +881,24 @@ class ProfileXYZ(Profile, SQLSubModel): # Interpolate points at river left side if (i_left > 0): - fact = (z - self.point(i_left).z) / (self.point(i_left - 1).z - self.point(i_left).z) - x = self.point(i_left).x + fact * (self.point(i_left - 1).x - self.point(i_left).x) - y = self.point(i_left).y + fact * (self.point(i_left - 1).y - self.point(i_left).y) - #x = np.interp( - #z, - #[self.point(i_left - 1).z, self.point(i_left).z], - #[self.point(i_left - 1).x, self.point(i_left).x] - #) - #y = np.interp( - #z, - #[self.point(i_left).z, self.point(i_left - 1).z], - #[self.point(i_left).y, self.point(i_left - 1).y] - #) + fact = (z - self.point(i_left).z) / (self.point(i_left - 1).z + - self.point(i_left).z) + x = self.point(i_left).x + fact * (self.point(i_left - 1).x + - self.point(i_left).x) + y = self.point(i_left).y + fact * (self.point(i_left - 1).y + - self.point(i_left).y) pt_left = PointXYZ(x=x, y=y, z=z, name="wl_left") else: pt_left = self.point(0) # Interpolate points at river right side if (i_right < self.number_points - 1): - fact = (z - self.point(i_right).z) / (self.point(i_right + 1).z - self.point(i_right).z) - x = self.point(i_right).x + fact * (self.point(i_right + 1).x - self.point(i_right).x) - y = self.point(i_right).y + fact * (self.point(i_right + 1).y - self.point(i_right).y) - #x = np.interp( - #z, - #[self.point(i_right).z, self.point(i_right + 1).z], - #[self.point(i_right).x, self.point(i_right + 1).x] - #) - #y = np.interp( - #z, - #[self.point(i_right).z, self.point(i_right + 1).z], - #[self.point(i_right).y, self.point(i_right + 1).y] - #) + fact = (z - self.point(i_right).z) / (self.point(i_right + 1).z - + self.point(i_right).z) + x = self.point(i_right).x + fact * (self.point(i_right + 1).x - + self.point(i_right).x) + y = self.point(i_right).y + fact * (self.point(i_right + 1).y - + self.point(i_right).y) pt_right = PointXYZ(x=x, y=y, z=z, name="wl_right") else: pt_right = self.point(self.number_points - 1) diff --git a/src/View/Results/CustomPlot/Plot.py b/src/View/Results/CustomPlot/Plot.py index c1240939..e30e5442 100644 --- a/src/View/Results/CustomPlot/Plot.py +++ b/src/View/Results/CustomPlot/Plot.py @@ -1416,3 +1416,16 @@ class CustomPlot(PamhyrPlot): ) labs = list(map(lambda line: self._trad[line], self.lines)) self.canvas.axes.legend(lns, labs, loc="best") + + def add_imported_plot(self, data): + if (data["type_x"] == self._x and + data["type_y"] in self._y): + while data["legend"] in self.lines: + data["legend"] += '*' + self._trad._dict[data["legend"]] = data["legend"] + data["unit"] + self.lines[data["legend"]] = self.canvas.axes.plot(data["x"], + data["y"], + marker="+", + linestyle="--") + self.update_legend() + self.idle() diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 0ef2cbc5..ed4f8d41 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -1243,24 +1243,12 @@ class ResultsWindow(PamhyrWindow): for line in lines: if line[0] != "*" and line[0] != "#" and line[0] != "$": row = line.split(sep) - print(row) if len(row) >= 2: try: x.append(float(row[0])) y.append(float(row[1])) except: pass - print(x) - print(y) - - # with open(filename, 'r', newline='') as f: - # reader = csv.reader(f, delimiter=sep, quotechar='|', - # quoting=csv.QUOTE_NONNUMERIC) - # for row in reader: - # print(row) - # if len(row) == 2: - # x.append(float(row[0])) - # y.append(float(row[1])) data_type_lst = ['Q(t)', 'Z(t)', 'Z(x)'] data_type, ok = QInputDialog.getItem( @@ -1269,8 +1257,7 @@ class ResultsWindow(PamhyrWindow): if not ok: return - legend, ok = QInputDialog.getText( - self, 'Legend','Legend:' ) + legend, ok = QInputDialog.getText(self, 'Legend', 'Legend:') if not ok: return @@ -1286,28 +1273,25 @@ class ResultsWindow(PamhyrWindow): tmp_unit = {'Z': ' (m)', 'Q': ' (m³/s)'} + data = {'type_x': tmp_dict[data_type[2]], + 'type_y': tmp_dict[data_type[0]], + 'legend': legend, + 'unit': tmp_unit[data_type[0]], + 'x': x, + 'y': y} + if data_type == 'Z(x)': line = self.canvas_2.axes.plot(x, y, marker="+", - label = legend + ' (m)') + label=legend + ' (m)') self.plot_rkc.canvas.draw_idle() self.plot_rkc.update_idle() if data_type == 'Q(t)': - line = self.canvas_4.axes.plot(x, y, - marker="+", - label = legend + ' (m³/s)') + line = self.canvas_4.axes.plot(x, y, marker="+", + label=legend + ' (m³/s)') self.plot_h._line.append(line) self.plot_h.enable_legend() + self.plot_h.canvas.draw_idle() + self.plot_h.update_idle + for p in self._additional_plot: - plot = self._additional_plot[p] - x_key = p.split(": ")[0] - y_key = p.split(": ")[1].split(",") - if (tmp_dict[data_type[2]] in x_key and - tmp_dict[data_type[0]] in y_key): - while legend in plot.lines: - legend += '*' - plot._trad._dict[legend] = legend + tmp_unit[data_type[0]] - plot.lines[legend] = plot.canvas.axes.plot(x, y, - marker="+", - linestyle="--") - plot.update_legend() - plot.idle() + self._additional_plot[p].add_imported_plot(data)