Skip to content

Commit

Permalink
Modify checks for categorical axis
Browse files Browse the repository at this point in the history
  • Loading branch information
amangoel185 committed Jun 29, 2021
1 parent 7d4a8bd commit 054c1c6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/hist/stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ def plot(
"""
Plot method for Stack object.
"""
_has_categorical = (
np.sum([ax.traits.discrete for ax in self._stack[0].axes]) == 1
)
_has_categorical = 0
if (
np.sum(self._stack[0].axes.traits.ordered) == 1
and np.sum(self._stack[0].axes.traits.discrete) == 1
):
_has_categorical = 1
_project = _has_categorical or overlay is not None
if self._stack[0].ndim == 1 or (self._stack[0].ndim == 2 and _project):
return [
Expand Down

0 comments on commit 054c1c6

Please sign in to comment.