How to plot overlapping parallel lines with a small offset to make them all visible?
Show older comments
I'm plotting (with "stairs") several linear functions in the same plot which occasionally overlap. This make the plot hard to read since then only the last plotted line is visible when the functions have the same values.
What I'm looking for is a way to tell the plot/stairs function to recognize that my lines are parallel and overlapping and then plot the lines over and under each other as they were a multicoloured thicker line.
Answers (1)
Fangjun Jiang
on 29 Nov 2011
0 votes
plot() or stairs() can't do that, as others might just want the opposite. You have to process it yourself by adding an offset, or consider using the line style and data point marker.
Categories
Find more on 2-D and 3-D Plots 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!