Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Line Plot: Single instance input fix #5408

Merged
merged 1 commit into from
Apr 23, 2021
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
2 changes: 1 addition & 1 deletion Orange/widgets/visualize/owlineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ def setup_plot(self):

def plot_groups(self):
self._remove_groups()
data = self.data[self.valid_data, self.graph_variables]
data = self.data[self.valid_data][:, self.graph_variables]
if self.group_var is None:
self._plot_group(data, np.where(self.valid_data)[0])
else:
Expand Down
8 changes: 8 additions & 0 deletions Orange/widgets/visualize/tests/test_owlineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ def test_group_var_none(self):
self.assertEqual(p, 2)
self.assertFalse(self.widget.graph.legend.isVisible())

def test_group_var_none_single_instance(self):
self.send_signal(self.widget.Inputs.data, self.housing[:1])
m, n, p = self.widget.graph.view_box._profile_items.shape
self.assertEqual(m, len(self.housing.domain.attributes))
self.assertEqual(n, 1)
self.assertEqual(p, 2)
self.assertFalse(self.widget.graph.legend.isVisible())

def test_datasets(self):
for ds in datasets.datasets():
self.send_signal(self.widget.Inputs.data, ds)
Expand Down