From graphics-request at octave dot org Tue Mar 7 22:58:06 2006 Subject: Re: Object Graphics v0.3 From: "Shai Ayal" To: "Bill Denney" Cc: graphics at octave dot org Date: Wed, 8 Mar 2006 06:56:26 +0200 On 3/8/06, Bill Denney wrote: > On Mon, 6 Mar 2006, Bill Denney wrote: > > >> legend object: > >> This is my creation and does not exist in matlab. Of course I am > >> flattered that you like it, but I think you should reconsider whether > >> it should be in the spec. > > > > I think that it makes sense as a separate object because of the fact that it > > is the only type that I can think of that will be linked to another type. In > > other words, it has the special property that it will draw generic lines but > > not use the line data, so it may have children that are also children of > > another object. > > I've been thinking more about the legend. > > I'm thinking that it is like an axis or group and could be removed except > for the fact that it has the linked objects. Perhaps we could introduct > an "Inherits" property for lines, patches, etc that would let all > properties that are not specified be read from another object? It could > be a little tricky, but I think it could work and it could remove the need > for a legend. > > How does that sound? I'm not sure -- In octplot, when creating the legend objects the line from the axes are copied to the legend. This is relatively easy to implement. You proposition is far from simple. I think see handles as pointers in c/c++: If you want object1 to have a pointer to object2 (The inherit property) than you have to deal with what happens if object2 is deleted? In the children property this is relatively simple to keep track of because of the simple hierarchical structure -- if an object is deleted, just notify the parent, but if you start cross-pointing you will run into a lot of problems. This also opens up the question of object deletions -- i.e. the following should of course be possible set(gca(),"children",sort(get(gca(),"children"))) but what about this? set(gca(),"children",get(gca(),"children")(1:end-1)) what does the leading brand do? Shai