Skip to content

DataFrame#plot and Vector#plot not working #482

Open

Description

@lokeshh
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.

Activity

  1. Shekharrajak commented on Jan 18, 2019

    @Shekharrajak
    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.

  2. lokeshh commented on Jan 19, 2019

    @lokeshh
    MemberAuthor

    @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>'
  3. lokeshh commented on Jan 19, 2019

    @lokeshh
    MemberAuthor

    @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.

  4. Shekharrajak commented on Jan 19, 2019

    @Shekharrajak
    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

  5. lokeshh commented on Jan 21, 2019

    @lokeshh
    MemberAuthor

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

  6. Shekharrajak commented on Jan 21, 2019

    @Shekharrajak
    Member

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

  7. lokeshh commented on Jan 21, 2019

    @lokeshh
    MemberAuthor

    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
  8. Shekharrajak commented on Jan 22, 2019

    @Shekharrajak
    Member

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

  9. lokeshh commented on Jan 23, 2019

    @lokeshh
    MemberAuthor

    Ok thanks.

  10. homonecloco commented on Oct 17, 2019

    @homonecloco

    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.

  11. NicolasNeiman commented on Oct 13, 2020

    @NicolasNeiman

    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 ?

  12. lokeshh commented on Oct 17, 2020

    @lokeshh
    MemberAuthor

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

  13. lokeshh commented on Oct 17, 2020

    @lokeshh
    MemberAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions