Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Orange/widgets/visualize/owscatterplotgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,8 @@ def update_coordinates(self):
x, y = self.get_coordinates()
if x is None or len(x) == 0:
return

self._reset_view(x, y)
if self.scatterplot_item is None:
if self.sample_indices is None:
indices = np.arange(self.n_valid)
Expand All @@ -851,7 +853,6 @@ def update_coordinates(self):
self.update_labels()

self.update_density() # Todo: doesn't work: try MDS with density on
self._reset_view(x, y)

# Sizes
def get_sizes(self):
Expand Down
4 changes: 2 additions & 2 deletions Orange/widgets/visualize/tests/test_owscatterplotbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def test_update_coordinates_and_labels(self):
xy[0][0] = 1.5
graph.update_coordinates()
self.assertEqual(graph.labels[0].pos().x(), 1.5)
xy[0][0] = 0 # This label goes out of the range
xy[0][0] = 0 # This label goes out of the range; reset puts it back
graph.update_coordinates()
self.assertEqual(graph.labels[0].pos().x(), 2)
self.assertEqual(graph.labels[0].pos().x(), 0)

def test_update_coordinates_and_density(self):
graph = self.graph
Expand Down