Class: GraphKit::MultiWindow

Inherits:
Array
  • Object
show all
Defined in:
lib/graphkit.rb,
lib/graphkit/gnuplot.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
# File 'lib/graphkit/gnuplot.rb', line 559

def method_missing(meth, *args)
  if args[-1].kind_of? Hash
  options = args.pop 
  else 
    options = {}
  end
  raise "Nothing to plot: size = 0" if size==0
  self[0].gp.multiplot = "layout #{size},1"
  for i in 1...self.size
    self[i].gp.multiplot_following = true
  end
  Gnuplot.open(true) do |io|
    options[:io] = io
    each do |gk|
      #p gk.to_s
      gk
      gk.send(meth, *args, options)
    end
    options.delete(:io)
  end
  for i in 1...self.size
    self[i].multiplot = false
  end
end