domitry / Nyaplotjs

JavaScript plotting library
http://nyaplotjs.readthedocs.org
Other
21 stars 7 forks source link

Box plot median is incorrect #18

Closed dansbits closed 8 years ago

dansbits commented 8 years ago

If I run the following example code the box plot is not correct.

plot = Nyaplot::Plot.new

data = [24, 24, 0, 24, 16, 28, 0, 16, 4, 0, 4, -8, -36, -4, 32, 40, -4, -20]

# calling data.median gives a value of 4, which is the correct median
p data.median # => 4

plot.add :box, data
plot.show

The plot below is what I get from plot.show. It shows that the median is 10: fig 1