MATLAB: Drawing Error bars with specific linestyle

errorbarsfigureslinestyle

Hello to everybody, does anyone know a way for drawing errorbars with the same style of the data line?
For example, when using:
d = errorbar(x,y,y_error,'Linestyle', ':');
MATLAB returns the data lines in dotted style, while the bars in each of the points are straight. What if I want also the bars in the dotted style?

Best Answer

EDIT, issued solved.
There is an undocumented "Bar" property associated with the errorbar command.
Therefore, you can set the style of your bar line with a syntax like this:
d = errorbar(1:3, 1:3, 1:3, 'LineStyle', ':');
d.Bar.LineStyle = 'dotted';