> Hello,
>
> to make things worse - it can be both, of course not at the same
time. If you call lengend('line1','line2') then >its a child of the
current figure or legend(gca,'line1','line2') then its a child of the
current axes. By the way >the same is true for colorbar.
> So, you need to be able to add/delete a property to a graphic object
on demand. It seems Matlab has two >functions for adding a property
'addproperty' and 'addynprop' but I don't know the differences.
I have no access to matlab so I rely only on their web documentation.
It seems legend is a simple axes object (child of figure). From the
point of view of the backend it is just another axes. The fronend has
to make sure it has the right position and in the right layer so it
will be drawn in front of the plot, and also, by giving it a special
"tag", make sure there is only one legend per plot.
If indeed it can be also a child of axes, it does complicate things,
but it does not imply adding a new property on the fly. It just
implies that axes can have axes as children.
Shai