class GraphKit::MultiKit
Public Class Methods
uninspect(arr, ivars)
click to toggle source
# File lib/graphkit.rb, line 281 def self.uninspect(arr, ivars) mkit = new(arr) ivars.each do |var,val| mkit.instance_variable_set(var,val) end mkit end
Public Instance Methods
+(other)
click to toggle source
# File lib/graphkit.rb, line 295 def +(other) merge(other) end
gnuplot(*args)
click to toggle source
# File lib/graphkit/gnuplot.rb, line 579 def gnuplot(*args) meth = :gnuplot #unless [:gnuplot, :gnuplot_write].include? 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 = options[:multiplot] || "layout #{size},1" gp.multiplot ||= options[:multiplot] || "layout #{size},1" for i in 0...self.size self[i].gp.multiplot_following = true end Gnuplot.open(true) do |io| @gnuplot_sets.apply(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 0...self.size self[i].multiplot_following = false end end
gnuplot_sets()
click to toggle source
# File lib/graphkit/gnuplot.rb, line 568 def gnuplot_sets # gnuplot_options included for back. comp @gnuplot_sets ||= GnuplotSetOptions.new @gnuplot_sets end
Also aliased as: gp
inspect()
click to toggle source
# File lib/graphkit.rb, line 299 def inspect "GraphKit::MultiKit.uninspect(#{super}, :@gnuplot_sets=>#{@gnuplot_sets.inspect})" end
merge(other)
click to toggle source
# File lib/graphkit.rb, line 288 def merge(other) size.times do |i| self[i] += other[i] if other[i] end self end
method_missing(meth, *args)
click to toggle source
# File lib/graphkit/gnuplot.rb, line 575 def method_missing(meth, *args) self[0].send(meth, *args) end