require 'numo/gnuplot'
a = Array.new(10) { |i| i }
b = Array.new(10) { |i| 2 * i }
c = Array.new(10) { |i| 3 * i }
d = Array.new(10) { |i| 4 * i }
data = [a, b, c, d]
Numo.gnuplot do
debug_on
set style: [histogram: :clustered]
set style: [fill: :solid]
plot [*data, using: 1, w: :histogram, t: 'A'],
[*data, using: 2, w: :histogram, t: 'B'],
[*data, using: 3, w: :histogram, t: 'C'],
[*data, using: 4, w: :histogram, t: 'D']
end
次のような表示になります
アウトプットはこんな感じでした
set style histogram clustered
set style fill solid
set term png
set output "output.png"
plot '-' using 1 w histogram t "A", '-' using 2 w histogram t "B", '-' using 3 w histogram t "C", '-' using 4 w histogram t "D"
0 0 0 0
1 2 3 4
...
9 18 27 36
e
お忙しいところ申し訳ございません. 大変暑い日が続いていますが日本語で失礼します. 棒グラフを表示したいのですが、下記のように書くと
次のような表示になります
アウトプットはこんな感じでした
'B' 'C' 'D' の一番最後が表示されていません。、きちんと表示するにはどうすればよいでしょうか? これはnumo-gnuplotの問題ではない気もしますが念のため報告します。