help-octave
[Top][All Lists]
Advanced

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

Re: Automatically plot to image instead of window?


From: Søren Hauberg
Subject: Re: Automatically plot to image instead of window?
Date: Mon, 12 Jul 2010 16:08:23 +0200

man, 12 07 2010 kl. 15:54 +0200, skrev Martin Helm:
> Am Montag, 12. Juli 2010 14:57:13 schrieb Jake:
> > Hello all,
> > 
> > I'm working on an Octave interface project and I was wondering if there's a
> >  way to make Octave automatically plot to file instead of to a
> >  window...without injecting print statements.  Thanks in advance.
> > 
> 
> Hello, 
> 
> there are at least two different ways to create file output from a plot which 
> come to my mind.
> Create raw gnuplot commands if you want them for automatic postprocessing by 
> an additional process but this also injects new code (option to the plot 
> functions) and is maybe not really what you want.
> Or you shadow your plot functions with your own local plot functions which do 
> then essentially a print.
> 
> Maybe someone else has a better or more elegant idea.

I can't really think of anything elegant. But you might be able to do
this using a listener. So, if you e.g. know that some property of the
axes always changes when you create a new plot you could do something
like (totally untested code)

  function my_listener ()
    print test.eps
  endfunction

  addlistener (gca (), "some_property", @my_listener);

I doubt this will work, though, is you need to find a property that
always changes, and I'm not sure you'll be able to find such one.

Søren



reply via email to

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