In Files

Parent

Methods

Files

Gnuplot::Style

Use a Style along with a Graph object to control the appearance in the plot.

Example:

 style_object = Style.new(color: :gold)
 graph_object = FormulaGraph.new(formula: "sin(x)", style: style_object)

Attributes

type[RW]

Possible values are: :lines, “points”, :dots, etc. More options are documented in the Gnuplot manual.

size[RW]

Sets point size, expects Fixnum

width[RW]

Sets line width, expects Fixnum

color[RW]

To set the color of your graph you have two options.

  • color is a Fixnum: A number, which represents a preset depending on the used terminal will be used to set the color.
  • color is a String or a Symbol: Color will be interpreted as a color name wich has to be supported by the given terminal. Gnuplot code will be: rgb ‘color’

Public Class Methods

new(options) click to toggle source

(Not documented)

# File gnuplot.rb, line 332
    def initialize options
      options.each do |attr,value|
        attr = ("@" + attr.to_s)
        instance_variable_set attr, value
      end
    end

Public Instance Methods

to_gnuplot() click to toggle source

(Not documented)

# File gnuplot.rb, line 339
    def to_gnuplot
      str = ""

      s = instance_variable_not_empty? "@type"
      str += "with #{s} " if s

      s = instance_variable_not_empty? "@color"
      str += (s =~ /^\d+$/) ? "linecolor #{s} " : "linecolor rgb \'#{s}\' " if s

      s = instance_variable_not_empty? "@size"
      str += "pointsize #{s} " if s

      s = instance_variable_not_empty? "@width"
      str += "linewidth #{s} " if s

      str
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.