require 'numo/gnuplot'
x = ['2017-01-01', '2017-01-02']
y = [1, 2]
Numo.gnuplot do
set xdata: 'time'
set timefmt: '%Y-%m-%d'
plot x, y, u: [1, 2], w: :lines
end
# line 3: warning: Skipping data file with no valid points
#
# gnuplot> plot '-' u 1:2 w lines
# ^
# line 3: x range is invalid
Gemファイルの_plot_splotメソッド
# gnuplot.rb 90行〜96行
def _plot_splot(cmd,contents)
r = contents.shift.map{|x| "#{x} "}.join
c = contents.map{|x| x.cmd_str}.join(", ")
d = contents.map{|x| x.data_str}.join
p d
run "#{cmd} #{r}#{c}", d
nil
end
いつもnumo-gnuplotで大変お世話になっております。日本語で失礼します。 numo-gnuplotで時系列の折れ線グラフを書きたいのですがうまく描けません。
Gemファイルの_plot_splotメソッド
のなかで p d すると
となり、e回避の?ダブルクオテーションが邪魔をしているように思われます。 うまく回避する方法はありませんか?
Ubuntu 4.4.0 ruby 2.4.1 gnuplot 5.0.6