Skip to content

Commit

Permalink
Distributions: Always show bars when no fitted distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Feb 14, 2025
1 parent e67650f commit e4f262f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit e4f262f

Please sign in to comment.