Open
Description
How can timeseries data best be plotted using this gem?
When using
require 'gnuplot'
Gnuplot.open do |gp|
Gnuplot::Plot.new(gp) do |plot|
plot.xdata :time
plot.timefmt '"%s"'
plot.format 'x "%H:%m"'
plot.data << Gnuplot::DataSet.new( [[Time.now, Time.now + 60], [1, 2]] ) do |ds|
ds.with = "linespoints"
ds.title = "Howdy"
end
end
end
the errors I get are:
gnuplot> plot '-' title 'Howdy' with linespoints
^
line 0: Need full using spec for x time data
gnuplot> 2015-11-23 18:46:14 +0100 1
^
line 0: invalid command
gnuplot> 2015-11-23 18:47:14 +0100 2
^
line 0: invalid command
Workaround: add ds.using = '1:2'
to the dataset.
Would it be better if this gem includes a default using
for each dataset?
Metadata
Metadata
Assignees
Labels
No labels