Problem with __plt_get_axis_arg__.m

David Bateman adb014 at gmail.com
Sun Dec 2 10:27:07 CST 2007


Michael Goffioul wrote:
> On 12/1/07, David Bateman <adb014 at gmail.com> wrote:
>> I tried to copy the hggroup code you had in one of the other functions
>> to __get_plt_axis__ so I'd say as JHandles is the only thing with
>> hggroups at the moment, change it how you need it to be changed..
> 
> IIRC, I used the "ancestor" call, because the next statement was
> something like "axes(h)", so I needed an axes object. I think that
> __plt_get_axis_arg__ should not call ancestor, otherwise you screw
> up the actual parent given as argument if it's not an axes object.

Huh? Doesn't ancestor just call h = get(h,"Parent") till get(h,"Type")
is "axes"? Why should that screw up the parent object? IT shouldn't
alter it...

> OTOH, functions that make use of the returned handle, should be
> aware that it might not be an axes object. I see 2 possible ways to
> deal with that:
> 1) use an additional output to __plt_get_axis_arg__ for the actual
> axes object, so any function that needs an axes object can get
> access to it

This is what I previously did with a NaN handle returned and no call to
gca() to prevent a figure window appearing for calls like "[x,y,z] =
sphere(20)". How I solved this was that if the leading argument to
__plt_get_axis__ is a logical value then it sets the value nogca. If the
nogca variable is logically true don't call gca, and let the parent
function deal with it..

In fact what you seem to be saying is the same issue, and the nogca flag
 should be expanded to also protect the call to ancestor.. What about
something like the attached patch in that case.


> 2) make "axes" function to call "ancestor" if the given handle is not
> an axes object

This is not compatible and will likely cause other issues.


D.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch39
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20071202/9334407c/attachment.ksh 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch39.changelog
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20071202/9334407c/attachment-0001.ksh 


More information about the Octave-maintainers mailing list