help-octave
[Top][All Lists]
Advanced

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

Re: default properties for axis label objects


From: John W. Eaton
Subject: Re: default properties for axis label objects
Date: Tue, 5 Oct 2010 15:23:00 -0400

On  5-Oct-2010, John W. Eaton wrote:

| On  5-Oct-2010, Ben Abbott wrote:
| 
| | I had a typo in my first attempt. Using Matlab, this works for me.
| | 
| |     fcn = @(varargin) set (get (gca, 'ylabel'), 'rotation', 0, 
'horizontalalignment', 'right');
| |     set (0, 'defaultaxescreatefcn', fcn)
| 
| Thanks.  This doesn't work in Octave yet, so I've filed a bug report
| about it so we will remember to look at the problem.

The problem is with recursion because the callback function, which is
executed by gca, also calls gca.  Matlab avoids the recursion, but I'm
not sure how.  But the handle of the object that is being created is
passed to the createfcn callback, so you can write

  fcn = @(h) set (get (h, 'ylabel'), 'rotation', 0,
                  'horizontalalignment', 'right');

to avoid the recursion and it will also work in Octave.

jwe


reply via email to

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