Skip to content

Commit 43d3c22

Browse files
committed
Fix dimension mismatch
1 parent a2a2258 commit 43d3c22

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/unicode_plot/interface/lineplot.cr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ module UnicodePlot
107107
head_tail : Symbol? = nil,
108108
head_tail_frac : Float64 = 0.05,
109109
) : Plot
110+
raise ArgumentError.new("x and y must have the same length") unless x.size == y.size
110111
c = color == :auto ? plot.next_color! : color
111112
col = plot_color(c)
112113
plot.label!(:r, name, col) unless name.empty?

src/unicode_plot/interface/scatterplot.cr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ module UnicodePlot
8282
color : Symbol | UInt32 | {Int32, Int32, Int32} = :auto,
8383
marker : Symbol | Char | String = :pixel,
8484
) : Plot
85+
raise ArgumentError.new("x and y must have the same length") unless x.size == y.size
8586
c = color == :auto ? plot.next_color! : color
8687
col = plot_color(c)
8788
plot.label!(:r, name, col) unless name.empty?

0 commit comments

Comments
 (0)