Skip to content

Commit

Permalink
Merge pull request #3024 from ales-erjavec/fixes/scatterplot-line
Browse files Browse the repository at this point in the history
[FIX] owscatterplot: Use correct data for regression line
  • Loading branch information
lanzagar authored May 11, 2018
2 parents b478b6c + 91630ac commit c32617f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Orange/widgets/visualize/owscatterplotgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,16 @@ def update_data(self, attr_x, attr_y, reset_view=True):

self.scatterplot_item.selected_points = []
self.scatterplot_item.sigClicked.connect(self.select_by_click)
if self.show_reg_line:
_x_data = self.data.get_column_view(self.shown_x)[0]
_y_data = self.data.get_column_view(self.shown_y)[0]
_x_data = _x_data[self.valid_data]
_y_data = _y_data[self.valid_data]
assert _x_data.size
assert _y_data.size
self.draw_regression_line(
_x_data, _y_data, np.min(_x_data), np.max(_y_data))

self.draw_regression_line(x_data, y_data, min_x, max_x)
self.update_labels()
self.make_legend()
self.plot_widget.replot()
Expand Down

0 comments on commit c32617f

Please sign in to comment.