Skip to content
Snippets Groups Projects
Commit d0b7c72f authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Add button to recompute the plot limits

parent 26575b3e
No related branches found
No related tags found
1 merge request!256Add button to recompute the plot limits
Pipeline #92636 passed
...@@ -147,10 +147,15 @@ class PlotWindow(QDialog): ...@@ -147,10 +147,15 @@ class PlotWindow(QDialog):
# self.ontop_checkbox.setCheckState(Qt.CheckState.Unchecked) # self.ontop_checkbox.setCheckState(Qt.CheckState.Unchecked)
# listlayout.addWidget(self.ontop_checkbox) # listlayout.addWidget(self.ontop_checkbox)
relim_button = QPushButton("&Recompute limits")
relim_button.clicked.connect(self._relim)
listlayout.addWidget(relim_button)
# Add "Close" buttons # Add "Close" buttons
button_close = QPushButton("&Close", self) button_close = QPushButton("&Close", self)
button_close.clicked.connect(self.close) button_close.clicked.connect(self.close)
listlayout.addWidget(button_close) listlayout.addWidget(button_close)
self._relim()
# Done. Tell the functions below to redraw the canvas when needed. # Done. Tell the functions below to redraw the canvas when needed.
# self.plotcanvas.draw() # self.plotcanvas.draw()
...@@ -197,6 +202,13 @@ class PlotWindow(QDialog): ...@@ -197,6 +202,13 @@ class PlotWindow(QDialog):
if self._auto_redraw: if self._auto_redraw:
self._update_legend() self._update_legend()
def _relim(self, event=None):
self._plot_axes.relim(True)
self._plot_axes.autoscale(True)
self._plot_axes.autoscale(axis='x', tight=True)
self._plot_axes.autoscale(axis='y')
self._plot_canvas.draw()
def start_simulation_dialog( def start_simulation_dialog(
sim_results: Dict[str, List[complex]], sfg_name: Optional[str] = None sim_results: Dict[str, List[complex]], sfg_name: Optional[str] = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment