Created
July 12, 2015 04:49
-
-
Save komasaru/1395add506fd9a1a4bd6 to your computer and use it in GitHub Desktop.
Ruby script to draw a graph by gnuplot.(Ex.3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/local/bin/ruby | |
#----------------------------------------------- | |
# Ruby script to draw a graph by gnuplot.(Ex.3) | |
#----------------------------------------------- | |
require 'gnuplot' | |
Gnuplot.open do |gp| | |
Gnuplot::SPlot.new(gp) do |plot| | |
plot.terminal "png enhanced font 'IPA P ゴシック' fontscale 1.2" | |
plot.output "gnuplot_3.png" | |
plot.set "object 1 rect from screen 0,0 to screen 1,1 fc rgb '#D0D0E0' fillstyle solid 1.0 behind" | |
plot.title "作成例3" | |
plot.xrange "[-10:10]" | |
plot.yrange "[-10:10]" | |
plot.xlabel "x" | |
plot.ylabel "y" | |
plot.zlabel "z" | |
plot.pm3d | |
plot.grid | |
plot.data << Gnuplot::DataSet.new("sin(x)*cos(y)") do |ds| | |
ds.with = "lines" | |
ds.linecolor = 6 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment