MATLAB Answers


How to change line style of a plotted graph?

Asked by Roel
on 17 Dec 2014
Latest activity Commented on by Roel
on 18 Dec 2014
I would like to change the linestyle of a plotted graph for making color blind people to understand my graph. The graph is already plotted. I have no basic data (anymore), but only the saved figure. I tried the follwing:
hline = findobj(gcf, 'type', 'line')
But that didnt seem to work.I added my graph.
Does anyone knows how to do this?


Mmm, i do not know what i am doing wrong. I have indeed only one figure open.I also cleared my workspace. Does other versions of matlab have influence maybe?
I do manage to change the legend of the figure. But the plotted lines in the figure remain the same.
I found my mistake, had to change 1 in hline(1) to 7,8 or 9. Thanks anyway.

Sign in to comment.

1 Answer

Answer by Azzi Abdelmalek
on 17 Dec 2014
 Accepted Answer

If we test this example
hline = findobj(gcf, 'type', 'line')
It seems to work


Sign in to comment.