Zooming into lines to access context menu
Show older comments
Hi,
I am developing a GUI in which a context menu is assigned to each line drawn by "plot" command. One thing that needs improvement is that there are many lines and right clicking on them needs precision. Therefore, I provided a zoom capability. The problem is when I zoom, it has no effect on the width of the line and it stays as thin as before no matter how many times you zoom in. I tried to change the width of the lines, but seems like the handle is not assigned to the width of the line. Do you have any suggestions that zooming can make it easier to right click on lines?
Thanks, Mehrdad
Accepted Answer
More Answers (1)
Ankitha Kollegal Arjun
on 9 Feb 2017
A suggestion on modifying the width of individual lines in a plot:
You can create a handle to the plot command and then access each line individually and modify its LineWidth property. Consider the following example:
x1 = 1:10;
y1 = x1;
y2 = x1.^2;
h = plot(x1,y1,x1,y2);
set(h(1),'LineWidth',5);
set(h(2),'LineWidth',10);
1 Comment
Mehrdad Sheikholeslami
on 9 Feb 2017
Thank you for the answer. I had already tried that and as I mentioned, the area that you can right click on a line for the context menu doesn't get bigger with increasing the line width.
Categories
Find more on Data Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!