In Files

Parent

Files

Gnuplot::Plot_

Constants

QUOTED
(Not documented)

Attributes

graphs[R]

(Not documented)

ranges[R]

(Not documented)

sets[R]

(Not documented)

Public Class Methods

new(options) click to toggle source

(Not documented)

# File gnuplot.rb, line 94
    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

Public Instance Methods

graphs=(graphs) click to toggle source

(Not documented)

# File gnuplot.rb, line 106
    def graphs= graphs
      graphs = Array.new_first_order graphs
      graphs.childs_are? Graph
      @graphs = graphs
    end
method_missing(attribute, *arguments) click to toggle source

(Not documented)

# File gnuplot.rb, line 118
    def method_missing attribute, *arguments
      attribute = attribute.to_s
      attribute = attribute[0..-2] if attribute[-1] == "="
      set attribute, *arguments
    end
ranges=(ranges) click to toggle source

(Not documented)

# File gnuplot.rb, line 112
    def ranges= ranges
      ranges = Array.new_first_order ranges
      ranges.childs_are? Range
      @ranges = ranges
    end
set(attribute, *arguments) click to toggle source

(Not documented)

# File gnuplot.rb, line 124
    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
to_gnuplot() click to toggle source

(Not documented)

# File gnuplot.rb, line 135
    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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.