Page 1 of 1
Matlab wandering legend
Posted: August 1st, 2008, 10:52 pm
by ana3a
i have plot legends in a GUI that are drag-and-droppable. it's very annoying. i want to turn off the drag-and-drop.is there a way to do this?i turned off the HitTest property but that doesn't help.
Matlab wandering legend
Posted: August 2nd, 2008, 6:54 pm
by spmacdonald
Try setting the legend's buttondown callback fucntion to null.maybe this example will help you:x=0i;y=sin(x);plot(x,y);h=legend('sin');set(h,'ButtonDownFcn','');
Matlab wandering legend
Posted: August 2nd, 2008, 7:33 pm
by ana3a
works wonders, thanks.should have thought to query the button's properties but it hadn't cross my mind to think of the legend as an object with any properties at all.what kind of graphics object is this?subclass of axes?
Matlab wandering legend
Posted: August 2nd, 2008, 8:56 pm
by spmacdonald
I believe it is an Annotation object. Checkout HGgroup in the documentation for details. Also the 'Controlling Legends' page is useful.Matlab's documentation is awesome, it is one of the things that makes its high price tolerable.