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

Distributions: Always show bars when no fitted distributions #7029

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions Orange/widgets/visualize/owdistributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def _cont_plot(self):
x0 + xoff, bar_width, 0,
[tot_freq if self.cumulative_distr else freq],
colors, stacked=False, expanded=False, tooltip=tooltip,
desc=desc, hidden=self.hide_bars)
desc=desc, hidden=self.controls.hide_bars.isChecked())

if self.fitted_distribution:
self._plot_approximations(
Expand Down Expand Up @@ -744,7 +744,7 @@ def _cont_split_plot(self):
x0 + xoff, bar_width, 0 if self.stacked_columns else 0.1,
plotfreqs,
gcolors, stacked=self.stacked_columns, expanded=self.show_probs,
hidden=self.hide_bars,
hidden=self.controls.hide_bars.isChecked(),
tooltip=self._split_tooltip(
desc, np.sum(plotfreqs), total, gvalues, plotfreqs),
desc=desc)
Expand Down
10 changes: 10 additions & 0 deletions Orange/widgets/visualize/tests/test_owdistributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,16 @@ def test_hide_bars(self):
self.assertTrue(all(curve.opts["brush"] is not None
for curve in widget.curve_items))

self._set_fitter(1)
self._set_check(widget.controls.hide_bars, True)
self.assertTrue(all(bar.hidden for bar in widget.bar_items))

self._set_fitter(0)
self.assertTrue(all(not bar.hidden for bar in widget.bar_items))

self._set_fitter(1)
self.assertTrue(all(bar.hidden for bar in widget.bar_items))

def test_report(self):
"""Report doesn't crash"""
widget = self.widget
Expand Down
Loading