Skip to content

Commit 09d480b

Browse files
committed
Fix plotting consistency and validation
1 parent eac808b commit 09d480b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/unicode_plot/interface/stairs.cr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ module UnicodePlot
7272
color : Symbol | UInt32 | {Int32, Int32, Int32} = :auto,
7373
style : Symbol = :post,
7474
) : Plot
75+
raise ArgumentError.new("x and y must have the same length") unless x.size == y.size
76+
7577
c = color == :auto ? plot.next_color! : color
7678
col = plot_color(c)
7779
plot.label!(:r, name, col) unless name.empty?
7880

79-
raise ArgumentError.new("x and y must have the same length") unless x.size == y.size
8081
can = plot.canvas
8182
blend = can.blend?
8283
n = x.size

0 commit comments

Comments
 (0)