Skip to content

Commit 864e9da

Browse files
committed
fix small bug in SubTabs - additional plots should use subgrid not grid
1 parent 737cde8 commit 864e9da

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

src/sas/qtgui/Plotting/SubTabs.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
from PySide6 import QtWidgets
2-
from PySide6 import QtCore
3-
4-
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
51
import matplotlib.pyplot as plt
6-
7-
from sas.qtgui.Utilities import GuiUtils
2+
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
3+
from PySide6 import QtCore, QtWidgets
84

95
from sas.qtgui.Plotting import TabbedPlotWidget
106

7+
118
class SubTabs(QtWidgets.QTabWidget):
129
"""
1310
This class is for keeping all the subtabs for Plots that are displayed in these. One SubTabs item should
@@ -82,9 +79,8 @@ def rearrange_plots(self):
8279
This method is called after plotting the results for this tab. It arranges the plots in two columns with the
8380
big plot on the left side and all the other plots on the right side.
8481
"""
85-
print("rearrange_plots")
8682
axes = self.figure.get_axes()
87-
if len(axes) > 2:
83+
if len(axes) < 2:
8884
pass # nothing to do, just one plot needs to be shown in the middle
8985
elif len(axes) == 2:
9086
# two column gridspec needs to be applied
@@ -100,7 +96,7 @@ def rearrange_plots(self):
10096

10197
axes[0].set_position(self.gs[0].get_position(self.figure))
10298
for i in range(len(axes)-1):
103-
axes[i+1].set_position(self.gs[i].get_position(self.figure))
99+
axes[i+1].set_position(self.sub_gs[i].get_position(self.figure))
104100

105101

106102
class DockContainer(QtWidgets.QMainWindow):
@@ -173,4 +169,4 @@ def onclick(self, event):
173169
axs[big].set_position(axs[index].get_position())
174170
axs[index].set_position(temp)
175171
self.big = index
176-
self.draw()
172+
self.draw()

0 commit comments

Comments
 (0)