Bugs: Browse | Submit New | Admin

[#29130] SPlot

Date:
2011-04-14 16:33
Priority:
3
Submitted By:
Patrick Paranhos (pparanhos)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
SPlot

Detailed description
/home/pparanhos/dev/.gems/gems/gnuplot-2.3.6/lib/gnuplot.rb:271:in `to_gsplot': undefined method `[]' for
0.0275229357798165:Float (NoMethodError)

If I edit the gnuplot.rb as follow the code works. 
Basically comenting out gsplot and creating a copy og the to_gplot as to_gsplot

 def to_gsplot
    if ( self[0].kind_of? Array ) then
      tmp = self[0].zip( *self[1..-1] )
      tmp.collect { |a| a.join(" ") }.join("\n") + "\ne"
    elsif ( self[0].kind_of? Numeric ) then
      s = ""
      self.length.times { |i| s << "#{self[i]}\n" }
      s
    else
      self[0].zip( *self[1..-1] ).to_gplot
    end
  end

#   def to_gsplot
#     f = ""
#     
#     if ( self[0].kind_of? Array ) then
#       x = self[0]
#       y = self[1]
#       d = self[2]
# 
#       x.each_with_index do |xv, i|
#         y.each_with_index do |yv, j|
#           f << [ xv, yv, d[i][j] ].join(" ") << "\n"
#         end
#         # f << "\n"
#       end
#     elsif ( self[0].kind_of? Numeric ) then
#       self.length.times do |i| f << "#{self[i]}\n" end
#     else
#       self[0].zip( *self[1..-1] ).to_gsplot
#     end
#     
#     f
#   end
# end

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item