help-octave
[Top][All Lists]
Advanced

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

Re: Autosaving plots after each modification


From: Ben Abbott
Subject: Re: Autosaving plots after each modification
Date: Fri, 13 Feb 2015 16:53:11 -0500


On Feb 13, 2015, at 9:14 AM, Ben Abbott <address@hidden> wrote:

On Feb 13, 2015, at 2:26 AM, Alex K <address@hidden> wrote:

On Wed Feb 11 2015 at 4:36:55 PM Ben Abbott <address@hidden> wrote:
> On Feb 11, 2015, at 1:39 PM, Alex K <address@hidden> wrote:
>
> Hi!
>
> Is it possible to run a custom function every time any plot is changed? For example, when running `plot`, `axis` etc., if they modify a figure on the screen I would like to detect that and save it to a new file.
>
> I use gnuplot as backend, so any solution involving configuring gnuplot will also work for me.
>
> Thanks!
> Alex

If you can provide mode details, someone may have a more efficient solution … but for a general solution I’d add a listener to the figures “children” property.

See “help addlistener” to see how to do that.

Ben

Hi Ben,

Thanks for the reply! For more context, I'm trying to make octave auto-save plots to files on the disk every time they are updated. I've tried addlistener but it doesn't seem to work:

  function my_handler
    fprintf ("my_handler called\n");
  endfunction
  addlistener (gcf, "children", address@hidden, "my string"})
  sombrero

the handler is not getting called.

Best,
Alex

Ok, that’s embarrassing. I get no error, and it doesn’t work for me either.

There are many examples of this working correctly in Octave’s sources. (take a look at the m-file code of plotyy or subplot for examples).

Does anyone see a problem with Alex’s example?

Ben

I filed a bug report.

https://savannah.gnu.org/bugs/index.php?44242

Ben



reply via email to

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