23
Ruby x gnuplot 2013-11-17

Ruby - gnuplot on Mac

Embed Size (px)

DESCRIPTION

便利なグラフ描画ツール gnuplot を Ruby から操作できる gem Gnuplot をご紹介します。 Mac 上でのインストール方法、基本的な使い方を解説しています。

Citation preview

Page 1: Ruby - gnuplot on Mac

Ruby x gnuplot2013-11-17

Page 2: Ruby - gnuplot on Mac

グラフガ描キタイ !

Excel デハナク CUI デ !

トイウカ Ruby デコンナノ

Page 3: Ruby - gnuplot on Mac

ソンナアナタニ gnuplot

Page 4: Ruby - gnuplot on Mac

WHAT

Page 5: Ruby - gnuplot on Mac

gnuplot http://www.gnuplot.info/

!CUIタイプのグラフ描画ツール 対話型でもスクリプトでも利用可

Page 6: Ruby - gnuplot on Mac

HOW

Page 7: Ruby - gnuplot on Mac

01 インストール

Page 8: Ruby - gnuplot on Mac

01 インストール

ヒツヨウナモノ

1. Ruby

2. gnuplot

3. gem gnuplot

Page 9: Ruby - gnuplot on Mac

01 インストール

1. Ruby

モチロンカツアイシマス

Page 10: Ruby - gnuplot on Mac

01 インストール2. gnuplot

http://www.gnuplot.info/

!インストール

$ brew install gnuplot

!カクニン

$ gnuplot -V # バージョンヲヒョウジ

$ gnuplot # タイワモードヘ

> plot [-10:10] sin(x) # sinカーブガヒョウジサレタラOK

Page 11: Ruby - gnuplot on Mac

01 インストール3. gem Gnuplot

http://rubygems.org/gems/gnuplot

!

インストール

$ gem install Gnuplot

!

カクニン

$ irb

> require “gnuplot” # => true ナラOK

Page 12: Ruby - gnuplot on Mac

02 Hello, World!

Page 13: Ruby - gnuplot on Mac

02 Hello, World!require "gnuplot"

!

Gnuplot.open do |gp| # 01 Gnuplotブロックオープン

Gnuplot::Plot.new( gp ) do |plot| # 02 Plot.new

plot.xrange "[-10:10]" # 03 クカンヲキメテ

plot.data << Gnuplot::DataSet.new("sin(x)") # 04 グラフヲヒョウジ!

end

end

# => sin カーブガヒョウジサレタラOK

Page 14: Ruby - gnuplot on Mac

03 デモ

Page 15: Ruby - gnuplot on Mac

03 デモ

- サンプズ

- マルチプロット

- CSVデータノプロット

- フィットカーブ

Page 16: Ruby - gnuplot on Mac

マトメ

Page 17: Ruby - gnuplot on Mac

Ruby デグラフ

Page 18: Ruby - gnuplot on Mac

ワリトカンタンニデキマシタ

Page 19: Ruby - gnuplot on Mac

gnuplot: ビョウガ Ruby: ジゼンショリ

Page 20: Ruby - gnuplot on Mac

ソノタノサンプル !

https://github.com/rdp/ruby_gnuplot !

examples ナイニサンプル

Page 21: Ruby - gnuplot on Mac

ワザワザ Ruby デヤルカチガアルカハ…

Page 22: Ruby - gnuplot on Mac

ソノタノオプション !

Gruff x RMagic x ImageMagick https://github.com/topfunky/gruff !

GoogleCharts x Google Charts http://googlecharts.rubyforge.org/

Page 23: Ruby - gnuplot on Mac

キョウノサンプル !

https://github.com/gh640/ruby-gnuplot-trial