Skip to content

Commit 1f20598

Browse files
authored
Merge pull request #2434 from ales-erjavec/fixes/scatter-plot-jumping-plot
[Fix] Scatter Plot: Reset the axis width only when needed
2 parents b513d40 + a6168df commit 1f20598

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Orange/widgets/visualize/owscatterplot.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,6 @@ def update_regression_line(self):
496496
self.update_graph(reset_view=False)
497497

498498
def update_graph(self, reset_view=True, **_):
499-
axis = self.graph.plot_widget.getAxis("left")
500-
axis.textWidth = 0
501499
self.graph.zoomStack = []
502500
if self.graph.data is None:
503501
return

Orange/widgets/visualize/owscatterplotgraph.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,12 @@ def update_data(self, attr_x, attr_y, reset_view=True):
633633
self.master.Information.missing_coords.clear()
634634
self._clear_plot_widget()
635635

636+
if self.shown_y != attr_y:
637+
# 'reset' the axis text width estimation. Without this the left
638+
# axis tick labels space only ever expands
639+
yaxis = self.plot_widget.getAxis("left")
640+
yaxis.textWidth = 30
641+
636642
self.shown_x, self.shown_y = attr_x, attr_y
637643

638644
if self.jittered_data is None or not len(self.jittered_data):

0 commit comments

Comments
 (0)