Skip to content

Instantly share code, notes, and snippets.

@orlybg
Created December 5, 2011 23:24
Show Gist options
  • Save orlybg/1435886 to your computer and use it in GitHub Desktop.
Save orlybg/1435886 to your computer and use it in GitHub Desktop.
gnuolot example 2
require 'gnuplot'
# tryout 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)"
plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
ds.with = "lines"
ds.linewidth = 4
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment