rdp/ruby_gnuplot — pull request #21 by evnu (2013-04-30 08:09:37+00:00)
Title: Added helper to create linestyles

This commit adds a class Style to add linestyles to the plot. Usage

require "gnuplot"

Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
plot.xrange "[-10:10]"
plot.title "Sin Wave Example"
plot.ylabel "x"
plot.xlabel "sin(x)"

# Create the style
s = plot.style do |style|
style.lt = 1
style.lc = 3
end

plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
ds.with = "lines"
# Use the style in a plot
ds.ls = s
end
end
end