The Plot class represents the Gnuplot plot command.
Example:
Gnuplot::Plot.new(graphs: singraph, title: "plot title", xlabel: "xlabel", ylabel: "ylabel", ranges: 0..6, samples: 25)
(Not documented)
# File gnuplot.rb, line 105 def initialize options self.graphs = (options.include? :graphs) ? options.delete( :graphs ) : [] self.ranges = (options.include? :ranges) ? options.delete( :ranges ) : [] @sets = Hash.new options.each do |attr,value| set attr.to_s, value end end
(Not documented)
# File gnuplot.rb, line 117 def graphs= graphs graphs = Array.new_first_order graphs graphs.childs_are? Graph @graphs = graphs end
(Not documented)
# File gnuplot.rb, line 129 def method_missing attribute, *arguments attribute = attribute.to_s attribute = attribute[0..-2] if attribute[-1] == "=" set attribute, *arguments end
(Not documented)
# File gnuplot.rb, line 123 def ranges= ranges ranges = Array.new_first_order ranges ranges.childs_are? Range @ranges = ranges end
(Not documented)
# File gnuplot.rb, line 135 def set attribute, *arguments if QUOTED.include? attribute raise "#{attribute} needs 1 argument" if arguments.size == 0 value = arguments[0].to_gnuplot value = "'#{value}'" unless value =~ /^('|").*\1$/ else value = arguments.map{ |arg| arg.to_gnuplot }.join(" ") end @sets[ attribute ] = value end
(Not documented)
# File gnuplot.rb, line 146 def to_gnuplot return "" if @graphs.empty? str = "" @sets.each do |attribute, value| str += "set #{attribute}" str += value.empty? ? "\n" : " #{value}\n" end str += self.class::CMD + " " @ranges.each do |range| str += "[#{range.to_gnuplot}] " end @graphs.each_index do |i| str += ", " unless i == 0 str += @graphs[i].to_gnuplot end str end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.