Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is a possible implementation that sorts the x values if one with a lower value is attempted to be inserted.
if x_values.length ==0 x_values << x_value y_values << y_value + @y_offset else if x_values.last <= x_value x_values << x_value y_values << y_value + @y_offset else loc = x_values.bsearch_index{|x| x > x_value} x_values.insert(loc,x_value) y_values.insert(loc,y_value +@y_offset) end end @plot.redraw_needed = true
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Here is a possible implementation that sorts the x values if one with a lower value is attempted to be inserted.
if x_values.length ==0
x_values << x_value
y_values << y_value + @y_offset
else
if x_values.last <= x_value
x_values << x_value
y_values << y_value + @y_offset
else
loc = x_values.bsearch_index{|x| x > x_value}
x_values.insert(loc,x_value)
y_values.insert(loc,y_value +@y_offset)
end
end
@plot.redraw_needed = true
The text was updated successfully, but these errors were encountered: