8 CommentsOldest to Newest
What if there are multiple lines and we want to change the color of only the one we clicked on. Setting buttonDownFcn of each line separately does not sound practical.
If I had multiple lines e.g. h=plot(rand(5,5);
I can set their callback with one command: set(h,’ButtonDownFcn’,@changeColor);
Only the line you click on will change color. Is this what you mean?
Yes. Thank you.
Is it possible to change the color of a line when the mouse cursor hovers on it, without clicking. I could not see a “mouse over” kind of functionality in the documentation.
There is not currently an easy way to do this. You could take a look at this file exchange submission: http://www.mathworks.com/matlabcentral/fileexchange/27632-hover-highlight
Add a breakpoint in your callback routine and take a look at the properties of event_obj. You should be able to get the color of the line either from it or its parent.
I am in need of the two videos no. 1 and no.2 in the GUI guide videos. These two are not shown in your videos
I am at email@example.com
Where do you see No 1 and No 2 videos mentioned? Can you give me a page?