Graphic properties not working
Ben Abbott
bpabbott at mac.com
Tue Mar 24 10:10:38 CDT 2009
On Tuesday, March 24, 2009, at 09:56AM, "John W. Eaton" <jwe at octave.org> wrote:
>On 24-Mar-2009, Ben Abbott wrote:
>
>| Mathworks appears to be doing something special. How does Matlab
>| handle a situation like below?
>|
>| set (hg, "SomeProperty", SomeValue)
>|
>| If the property "SomeProperty" does not exst for the hggroup with
>| handle hg, does Matlab do something like ...
>|
>| set (findobj (hg, "-property", "SomeProperty"), "SomeProperty",
>| SomeValue)
>|
>| ... or is the current example unique?
>
>I don't know how this this functionality is implemented in Matlab.
>This is just a friendly reminder that you should never examine any
>Matlab m-file sources to determine how it works and then implement
>something for Octave based on that.
>
>jwe
>
I had a few minutes to investigate. I wrote a short script that tries to "get()" the patch properties from the hggroup. There are three properties that return a result and are not among the hggroup properities. They are; "CData", "CDataMapping", and "EdgeColor". When I tried to "set()" the properties instead, only two worked; "CDataMapping" and "EdgeColor".
Looking at "CData", where hp and hg are handles for a patch and the hggroup ...
>> get (hp, 'CData')
ans = 8.0000e+000
>> get (hg, 'CData')
ans = scaled
The set() for the hggroup failede because I tried set(hg,'CData',get(hp,'CData')), and the property type is different.
Looking at 'CDataMapping' ...
>> get (hp, 'CDataMapping')
ans = scaled
>> get (hg, 'CDataMapping')
ans = scaled
Looking at 'EdgeColor' ...
>> get (hp, 'EdgeColor')
ans = 0.0000e-0.003 0.0000e-0.003 0.0000e-0.003
>> get (hg, 'EdgeColor')
ans = 0.0000e-0.003 0.0000e-0.003 0.0000e-0.003
If I set the hggroup property 'CData' to 'direct', the 'CDataMapping' changes, but the patch property remains unchanged.
>> set (hg, 'CData', 'direct')
>> get (hg, 'CDataMapping')
ans = direct
>> get (hp, 'CDataMapping')
ans = scaled
This is different than the 'EdgeColor' ...
>> set (hg, 'EdgeColor', 'blue')
>> get (hp, 'EdgeColor')
ans = 0.0000e-003 0.0000e-003 1.0000e-000
Does anyone know if this behavior is documented?
Ben
More information about the Bug-octave
mailing list