Skip to content
New issue

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

Nyaplot uses index as default axis for vector but not for dataframe #6

Open
baarkerlounger opened this issue Aug 29, 2017 · 0 comments

Comments

@baarkerlounger
Copy link

df = Daru::DataFrame.new({y1: [11, 15, 8], y2: [9, 10, 3]}, 
     index: ["a", "b", "c"])
df.plot type: :bar, y: :y1 do |plot, diagram|
  plot.y_label "Frequency"
  plot.x_label "Category"
  plot.yrange [0,20]
end

Throws NoMethodError: undefined method to_sym' for nil:NilClass`

I would expect it to behave like Daru::Vector and take the index as default axis.

dv = df[:y1]
dv.plot type: :bar, y: :y1 do |plot, diagram|
  plot.y_label "Frequency"
  plot.x_label "Category"
  plot.yrange [0,20]
end

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant