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: bpabbott
Subject: Re: default properties for axis label objects
Date: Tue, 05 Oct 2010 21:15:31 +0000 (GMT)

On Oct 05, 2010, at 03:23 PM, "John W. Eaton" <address@hidden> wrote:

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
 
I don't know if Octave works differently, but for Matlab the callback occurs after the axis is created. Which I expect resolves the recursion problem.

Ben






reply via email to

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