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



566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/graphkit/gnuplot.rb', line 566

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 = 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

Instance Method Details

#gnuplot_setsObject Also known as: gp



559
560
561
562
563
# File 'lib/graphkit/gnuplot.rb', line 559

def gnuplot_sets
	# gnuplot_options included for back. comp
	@gnuplot_sets ||=  GnuplotSetOptions.new
	@gnuplot_sets
end