0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

fix(figure): if/else logic corrected in subplot_factory

This commit is contained in:
2024-07-01 13:31:00 +02:00
parent 1173510105
commit 3e787234c7

View File

@ -555,7 +555,7 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
return widget
# Case 3 - modifying existing plot wit coordinates provided
elif new is False and (row is not None and col is not None):
if new is False and (row is not None and col is not None):
try:
widget = self.axes(row, col)
except ValueError:
@ -568,9 +568,8 @@ class BECFigure(BECConnector, pg.GraphicsLayoutWidget):
return widget
# Case 4 - no previous plot or new plot, no config provided, possible to define coordinates
else:
widget = self.add_widget(widget_type=widget_type, row=row, col=col, **axis_kwargs)
return widget
widget = self.add_widget(widget_type=widget_type, row=row, col=col, **axis_kwargs)
return widget
def add_widget(
self,