% MAKELINEHIGHLIGHTABLE sets the ButtonDownFcn of lines or line children
% of axes so that when the line is clicked the line width is increased or
% decreased. when the line is clicked again the line width returns to the
% original value.
% MAKELINEHIGHLIGHTABLE(H,HIGHLIGHTPOINTS): H is a line or axes handle or a vector of line and/or axes handles
% HIGHLIGHTPOINTS(optional) is the number of points to
% increase (or decrease) the line width when the line is clicked. If not
% supplied the default value is 2.
% MAKELINEHIGHLIGHTABLE(H,0): turns off the highlightable ButtonDownFcn for the line handles in H.
% h = plot(1:10,rand(10));
% makeLineHighlightable(h) %increase line width by 2 when clicked
% a = get(h(1),'Parent');
% makeLineHighlightable(a,5); %increase by 5 all lines in the axes
% makeLineHighlightable(h(1:5),0); %turn off the first 5 lines highlighting
% makeLineHighlightable(a,0); %turn off all the lines highlighting
Matthew Whitaker (2021). makeLineHighlightable (https://www.mathworks.com/matlabcentral/fileexchange/17505-makelinehighlightable), MATLAB Central File Exchange. Retrieved .
Great job! It works perfectly with the current release (R2007b).
i opened this site and i liked it very much.
I have a naive question. If I open Figure Palette (ML R14) in figure window, I get any line object highlighted if I click it. This is reasonable, because it allows to see gco. Apparently, in the submission discussed here the highlighting has some other meaning. Which one?
Another question is for Doug. If I open uicontextmenu for gco with right button, I see option CUT, but there are no important options MOVE, BLOW UP/DOWN (both implemented in RECTANGLE AND ELLIPSE), and ROTATE (strangely, Rotate3D button in main toolbar cannot rotate single objects within fixed 2D axis). Of course, one can modify uicontextmenu, but such options are very general, why not yet implemented?
Furthermore, if I have a line object within RECTANGLE or ELLIPSE brought into axis from Annotations,instead of that object only RECTANGLE or ELLIPSE are always selected by clicking the line object. This seems to me inconsistent. What is the explanation for that? Apparently, RECTANGLE and ELLIPSE consider not only the perimiter, but also inner points as their own property. This is very inconvenient for users.
This file is the first winner of the LazyWeb challenge I posted on my Blog.
Revision submitted to turn off other lines when highlighting a line
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!