help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

making many plots quickly


From: John W. Eaton
Subject: making many plots quickly
Date: Wed, 08 Oct 2008 11:27:01 -0400

On  2-Oct-2008, Francesco Potorti` wrote:

| Using the movie.m function that I posted some time ago (and that you can
| find at <http://fly.isti.cnr.it/pub/software/octave/movie.m>) I can make
| movies from a series of plots saved on disk as .png files.
| 
| The way it works is that I use for each frame
|   figure("visible","off")
| then I create the plot and save it as png with
|   drawnow("png",sprintf("%6d.png",fileno++))
| and at the end I call ffmpeg or whatever.
| 
| When making many plots (hundreds or thousands) I see that octave and
| gnuplot take each 50% of CPU usage.  Looking ad drawnow.m, the cause
| seems to be that when drawing a plot to a file the pipe to gnuplot is
| closed each time.  If I could keep the pipe open, I could exploit having
| a dual-core CPU to make things faster.  And probably I would also save
| the CPU power needed to create and close a process for each frame.

I don't understand why opening and closing the plot stream would limit
you to one CPU.  Is opening and closing the pipe really the bottleneck
in the process?

If you want to keep the plot stream open, how do you propose doing it?
Remember that there may be a plot on the screen, and that should not
go away when drawnow is called again to print a plot to a file.  So
would you keep two plot streams open for each figure?  Or would there
be a dedicated gnuplot process just for printing?  Also, one advantage
to restarting gnuplot for each figure that is printed is that you
don't have to worry about the state of the gnuplot process, and
whether there have been any errors that might cause trouble.

| Is there in Octave any way to use gnuplot like this?

It doesn't seem so, from looking at gnuplot_drawnow.

| If not, would it make sense for me to submit a patch that modifies
| drawnow for general usage, so that it keeps the pipe open when possible?

Instead of asking us, why not just do it if you think it would help
you?  Then if the change is useful to you, it seems likely that it
might also be useful to others, so you might as well submit it.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]