-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Providing support for multiplot #11
Comments
looks like "not yet" though you can put multiple lines into a single graph: https://github.com/rdp/ruby_gnuplot/blob/master/examples/multiple_data_sets.rb |
anything changed in this case? |
Maybe in hope to get attention to this one, I would also very much like support for multiplots. |
I would like to put some work in trying to fix this, but I am fairly inexperienced with this kind of programming. Can someone maybe give me a few pointers for the steps which need to be taken? |
Actually, I just discovered this is possible already. It is a bit of a work-around, because you have to set the multilayout in the first Gnuplot::Plot you define. The following works: require '../lib/gnuplot'
$VERBOSE = true
Gnuplot.open do |gp|
Gnuplot::Plot.new(gp) do |plot|
plot.multiplot "layout 2,1"
plot.xrange "[-10:10]"
plot.title "Sin Wave Example"
plot.ylabel "x"
plot.xlabel "sin(x)"
plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
ds.with = "lines lc rgb 'blue'"
ds.linewidth = 4
end
end
Gnuplot::Plot.new(gp) do |plot|
plot.xrange "[-10:10]"
plot.title "Second sin Wave Example"
plot.ylabel "x"
plot.xlabel "sin(x)"
plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
ds.with = "lines lc rgb 'green'"
ds.linewidth = 4
end
end
end Because this is a "global" Gnuplot setting, it would be better to have this implemented on the level of Gnuplot. The resulting class should probably have the methods method_missing, set and unset implemented, together with a Note that any global setting can be provided this way. An other, very ugly, solution would be to direct insert command to the Gnuplot.open do |gp|
gp << "set multiplot layout 2,1\n"
Gnuplot::Plot.new(gp) do |plot|
end
end Note the |
nice :) |
Is it possible to create multi plots?
The text was updated successfully, but these errors were encountered: