Skip to content
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

Provide support for starting gnuplot process and keep it running #3

Open
protobits opened this issue Jun 30, 2010 · 6 comments
Open

Comments

@protobits
Copy link

What I mean is, provide support for doing:

gnuplot = Gnuplot.open
....
gnuplot.close

This way you can start gnuplot and have the process running and do multiple graphs from different parts of your code. This avoids starting up a gnuplot process for each plotting operation.

This could be achieved by simply doing:

if (block_given?) IO::popen( cmd, "w") { |io| yield io }
else IO::popen( cmd, "w")

at the openmethod

@rdp
Copy link
Owner

rdp commented Jun 30, 2010

I'd be happy to accept a pull request...or if not I might get around to it eventually.

@rdp
Copy link
Owner

rdp commented Jul 1, 2010

oh I see what you're saying now...
something like

@io ||+ IO::popen(cmd, "w")...

@protobits
Copy link
Author

I don't understand that syntax =b

@rdp
Copy link
Owner

rdp commented Jul 26, 2010

is gnuplot slow for you currently?

@protobits
Copy link
Author

Hi, actually, I'm not using ruby_gnuplot for my project. I was just assessing the capabilities of your code so I could see if it would serve my needs.
I ended up implemeting a very simple gnuplot interface in my ruby-gsl-ng code.

In any case, if you need to update the plot often (like I do, in a robotics simulator I developed) restarting the gnuplot process is out of the question. I've even had to resort to using binary data to speed things up.

@rdp
Copy link
Owner

rdp commented Jan 30, 2011

leaving open since I think you can do multiple plots, as described...so maybe someday would make for a speedup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants