Skip to content

Commit 90d4f5f

Browse files
authored
Merge pull request #5277 from janezd/pca-reset-zoom
SliderGraph: Disable auto scale button
2 parents 4014f24 + 12b9fe9 commit 90d4f5f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Orange/widgets/utils/slidergraph.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __init__(self, x_axis_label, y_axis_label, callback):
3636
self.getViewBox().setMouseEnabled(False, False)
3737
self.showGrid(True, True, alpha=0.5)
3838
self.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0))
39+
self.hideButtons()
3940

4041
# tuples to store horisontal lines and labels
4142
self.plot_horlabel = []
@@ -96,8 +97,7 @@ def update(self, x, y, colors, cutpoint_x=None, selection_limit=None,
9697
self.addItem(label)
9798

9899
self._plot_cutpoint(cutpoint_x)
99-
self.setRange(xRange=(x.min(), x.max()),
100-
yRange=(0, max(yi.max() for yi in y)))
100+
self.autoRange()
101101

102102
def clear_plot(self):
103103
"""
@@ -198,11 +198,12 @@ def _update_horizontal_lines(self):
198198
# in every case set their position
199199
location = int(round(self._line.value()))
200200
cutidx = np.searchsorted(self.x, location)
201+
minx = np.min(self.x)
201202
for s, curve, label, inc in zip(
202203
self.sequences, self.plot_horline, self.plot_horlabel,
203204
self.data_increasing):
204205
y = s[cutidx]
205-
curve.setData([-100, location], 2 * [y])
206+
curve.setData([minx, location], [y, y])
206207
self._set_anchor(label, cutidx, inc)
207208
label.setPos(location, y)
208209
label.setPlainText("{:.3f}".format(y))

0 commit comments

Comments
 (0)