class GraphKit::GnuplotPlotOptions
Constants
- GNUPLOT_SETS
- QUOTED
Public Instance Methods
[]=(opt, val)
click to toggle source
Calls superclass method
# File lib/graphkit/gnuplot.rb, line 211 def []=(opt, val) raise "#{opt} is not a valid gnuplot set option" unless GNUPLOT_SETS.include? opt super end
apply(io)
click to toggle source
# File lib/graphkit/gnuplot.rb, line 215 def apply(io) self[:function] ||= "'-'" GNUPLOT_SETS.each do |var| val = send(var) next unless val case var when :function io << " #{val} " when :title io << "#{var} '#{val}'" else if QUOTED.include? var.to_s and not val =~ Regexp.quoted_string io << "#{var} '#{val}' " else io << "#{var} #{val} " end end end end