Skip to content

Commit a4bc450

Browse files
committed
Fix shape error in step plot type check
1 parent 313d452 commit a4bc450

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

xarray/plot/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,16 @@ def _resolve_intervals_1dplot(
564564
if kwargs.get("drawstyle", "").startswith("steps-"):
565565

566566
remove_drawstyle = False
567+
567568
# Convert intervals to double points
568-
if _valid_other_type(np.array([xval, yval]), [pd.Interval]):
569+
x_is_interval = _valid_other_type(xval, [pd.Interval])
570+
y_is_interval = _valid_other_type(yval, [pd.Interval])
571+
if x_is_interval and y_is_interval:
569572
raise TypeError("Can't step plot intervals against intervals.")
570-
if _valid_other_type(xval, [pd.Interval]):
573+
elif x_is_interval:
571574
xval, yval = _interval_to_double_bound_points(xval, yval)
572575
remove_drawstyle = True
573-
if _valid_other_type(yval, [pd.Interval]):
576+
elif y_is_interval:
574577
yval, xval = _interval_to_double_bound_points(yval, xval)
575578
remove_drawstyle = True
576579

0 commit comments

Comments
 (0)