l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
October 7: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2005 May 24 21:14

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] tell gnuplot to use a single X11 window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] tell gnuplot to use a single X11 window



On Mon 23 May 05,  3:18 PM, Dylan Beaudette <dylan@iici.no-ip.org> said:
> On Monday 23 May 2005 03:03 pm, Peter Jay Salzman wrote:
> > On Mon 23 May 05,  2:55 PM, Dylan Beaudette <dylan@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.
> 
> Cool!
> 
> thanks for the tip Pete. I will give it a try tonight (this thing is due in a 
> couple of hours!) when i have some time.
> 
> any demos of the output that you mentioned?
> 
> Thanks,
 
Yeah, sure thing.  Download it here:

   http://www.dirac.org/p/dylan.tar.bz2

My Perl wrapper is called "plotter".  You'll see it.  You'll also see the
directory which is the output of my PDE solver.  It's called "data.22" (I
ran my PDE solver many many hundreds of times to cover a parameter space in
order to study the behavior of the PDE, so I resorted to uninspired names
for my data directory).

To see what options are available for my plotter, type:

   ./plotter --help
   ./plotter -h
   ./plotter -?

To see the plotter in action, try this:

   ./plotter -d data.22/ -x 1e-14 -y 4e14

The -x option sets the horizontal axis.
The -y option sets the vertical axis.
The -d option sets which directory to take the plot data from.
The -d option sets which directory to take the plot data from.

If the plot goes too fast, you can slow it down with the -p (pause) option,
which takes an integer argument: 

   ./plotter -d data.22/ -x 1e-14 -y 4e14 -p1


The -x and -y options can have the form of:

   -x from,to      -x 2,100    (x axis goes from 2 to 100)
   -x ,to          -x ,200     (x axis goes from 0 to 200)
   -x from,        -x 10,      (x axis goes from 10 to last datapoint)
   -x from         -x 5        (x axis goes from 5 to last datapoint)


It's loaded with options.  You can change the point size and even convert
your graphs to eps files, suitable for including into your latex
dissertation.   ;-)

Hope you find it useful.  It was a lot of fun to write.

Pete

PS- I'm not the best Perl hacker, but I can always get the job done.

-- 
Every theory is killed sooner or later, but if the theory has good in it,
that good is embodied and continued in the next theory. -- Albert Einstein

GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.