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

DataFrame#plot and Vector#plot not working #482

Open
lokeshh opened this issue Jan 18, 2019 · 13 comments
Open

DataFrame#plot and Vector#plot not working #482

lokeshh opened this issue Jan 18, 2019 · 13 comments

Comments

@lokeshh
Copy link
Member

lokeshh commented Jan 18, 2019

require 'daru'
Daru.plotting_library = :gruff
dv = Daru::Vector.new [1, 2, 3]
dv.plot do |p|
  p.title = 'lol'
end

result in following error:

SystemStackError: stack level too deep
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru.rb:54:in `block in create_has_library'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:209:in `plotting_library='
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:1498:in `init_plotting_library'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:222:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
/var/lib/gems/2.5.0/gems/daru-0.2.1/lib/daru/vector.rb:224:in `plot'
...

If looks to me the support for plotting in Daru has been removed or long been broken because Daru latest release gives the error that DataFrame#plot is not found. If the support for plotting has been removed (because its shifted to daru-view) we need to remove the appropriate notebooks from README and sciruby-notebooks.

@Shekharrajak
Copy link
Member

If the support for plotting has been removed (because its shifted to daru-view) we need to remove the appropriate notebooks from README and sciruby-notebooks.

I don't think it is removed from the daru. It looks different issue. I am able to run these lines using latest code.

@lokeshh
Copy link
Member Author

lokeshh commented Jan 19, 2019

@Shekharrajak Ok, but these lines are certainly not working in latest daru release.

NoMethodError: undefined method `plot' for "#<Daru::Vector(3)>\n   0   1\n   1   2\n   2   3"
	from /var/lib/gems/2.3.0/gems/daru-0.2.1/lib/daru/vector.rb:1420:in `method_missing'
	from (irb):4
	from /usr/bin/irb:11:in `<main>'

@lokeshh
Copy link
Member Author

lokeshh commented Jan 19, 2019

@Shekharrajak Also I'm getting error (the same I mentioned on top) on latest code. You might want to test on a new computer with only latest daru installed because that's what I did.

@Shekharrajak
Copy link
Member

Yes! I already tried the latest cloned version :

 ➜  daru git:(master*) bundle console 
irb(main):001:0> require 'daru'
=> false
irb(main):002:0> Daru.plotting_library = :gruff
=> :gruff
irb(main):003:0> dv = Daru::Vector.new [1, 2, 3]
=> #<Daru::Vector(3)>
   0   1
   1   2
   2   3
irb(main):004:0> dv.plot do |p|
irb(main):005:1*   p.title = 'lol'
irb(main):006:1> end
=> #<Gruff::Bar:0x000055ae4fac16a8 @columns=500.0 .................

I'll check 0.2.1

@lokeshh
Copy link
Member Author

lokeshh commented Jan 21, 2019

@Shekharrajak You are right, #plot is working in latest code. I hadn't installed gruff, so it was giving this weird error.

@Shekharrajak
Copy link
Member

Shekharrajak commented Jan 21, 2019

Thanks for the update. Actually, I tried in 0.2.1 version also it was fine.

@lokeshh
Copy link
Member Author

lokeshh commented Jan 21, 2019

I think a new Daru release is needed as with the last release the sciruby-notebooks won't be working. Also could you verify if gnuplot working for you?

Following lines give me Illegal seek error. What about you?

require 'gnuplotrb'
require 'daru'
include GnuplotRB

dv = Daru::Vector.new [:a, :a, :a, :b, :b], type: :category
Plot.new [dv.frequencies, with: 'histogram'], xrange: -1..2, yrange: 0..10

@Shekharrajak
Copy link
Member

@lokeshh , I installed gnuplotrb gem and run sudo apt-get install gnuplot-x11. It worked for me.

@lokeshh
Copy link
Member Author

lokeshh commented Jan 23, 2019

Ok thanks.

@homonecloco
Copy link

Hi,
I'm having the same error, I'm using Daru-0.2.2. Is this something fixed in the master branch? And if so, are you planning to do a release at some point? I prefer to use a fixed release for consistency.
Best,
Ricardo.

@NicolasNeiman
Copy link

NicolasNeiman commented Oct 13, 2020

Hi @lokeshh and @v0dro,

I'm using daru (0.3) and I'm getting the same error
SystemStackError: stack level too deep
Do you have the same issue on your end ?

@lokeshh
Copy link
Member Author

lokeshh commented Oct 17, 2020

@NicolasNeiman You need to install gruff gem first. You can do that by running gem install gruff.

@lokeshh
Copy link
Member Author

lokeshh commented Oct 17, 2020

@homonecloco I'm using daru 0.3 and plotting with gruff is working for me. I just had to add that gem using gem install gruff. If you see an error let me know.

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

4 participants