[vox-tech] tell gnuplot to use a single X11 window
Jonathan Stickel
jjstickel at sbcglobal.net
Mon May 23 15:17:38 PDT 2005
Peter Jay Salzman wrote:
> On Mon 23 May 05, 2:55 PM, Dylan Beaudette <dylan at iici.no-ip.org> said:
>
>>Hi everyone,
>>
>>is there any good way to get gnuplot to send its output to a single window,
>>such that any successive plots update an existing X11 window?
>>
>>i have looked over the gnuplot man page, and can't seem to find what i am
>>looking for.
>>
>>while it is a little ridiculous, i like to keep track of my progress while
>>writting with this little script:
>>
>>while `true`; do wc -w main.tex | awk '{print $1}' >> word_count ;\
>>echo "set ylab 'words'; set xlab 'minutes'; \
>>plot 'word_count' with lines notitle" | gnuplot -persist;\
>>sleep 60; done
>>
>>this produces a nice little graph updated once a minute. however, gnuplot on
>>linux produces a new window with every plot. on OSX it is possible to keep
>>all output in a single window* .
>>
>>* there is a bit of a difference on OSX, as an application called AquaTerm is
>>being used to render the output, not X11.
>>
>>any ideas on how to do this with regular X11?
>>
>>thanks!
>
>
> I had the same problem. My fix was to write a small perl script to wrap
> around gnuplot.
>
> The script writes a small gnuplot script and then invokes gnuplot with the
> script.
>
> When it comes time for a new plot, the script rewrites the gnuplot script,
> kills all instances of gnuplot, and re-runs gnuplot with the new gnuplot
> script.
>
> It works surprisingly well.
>
> Pete
>
> PS- The data is output of a time evolution partial differential equation.
> It creates a "movie" of the time evolution of a quantum wavefunction. Very
> cool.
>
Are either of you familiar with octave (www.octave.org)? It is
essentially a high level numerical programming language. It uses
gnuplot as it's primary plotting interface and, by default, plots
everything in the same window. You could probably write your scripts in
octave if you were interested in doing so.
Jonathan
More information about the vox-tech
mailing list