| 24 | self._window.setCentralWidget(self._widget) |
| 25 | |
| 26 | def create_plot_widget(self, plot_id="", xlabel="x_label", ylabel="y_label", |
| 27 | legend=True, background_color="k", window_length=100): |
| 28 | row = self._num_plots//self._plots_per_row |
| 29 | col = self._num_plots%self._plots_per_row |
| 30 | plot_widget = pg.PlotWidget() |
| 31 | plot_widget.setLabel('left', ylabel) |
| 32 | plot_widget.setLabel('bottom', xlabel) |
| 33 | plot_widget.setBackground(background_color) |
| 34 | if legend == True: |
| 35 | plot_widget.addLegend() |
| 36 | self._layout.addWidget(plot_widget,row,col) |
| 37 | if plot_id == "": |
| 38 | plot_id = str(self._num_plots) |
| 39 | self._plot_dict[plot_id] = self._num_plots |
| 40 | self._window_length_list.append(window_length) |
| 41 | self._xdata_list.append([]) |
| 42 | self._ydata_list.append([]) |
| 43 | self._data_lines_list.append([]) |
| 44 | self._data_line_labels.append({}) |
| 45 | self._num_plots += 1 |
| 46 | |
| 47 | def create_data_set(self, plot_id, data_label, data_color=(255,0,0), data_thickness=15): #add func to change line thickenss |
| 48 | plot_index = self._plot_dict[plot_id] |