Given the following example code:
x = 0:pi/10:pi;
y = sin(x);
e = std(y)*ones(size(x));
figure
errorbar(x,y,e)
How are you able to color the line different compared to the horizontal lines?
I tried
errorbar(x,y,e,'--mo')
But this changes all of them together...
Get a handle to the errorbar
object. It has two children, corresponding to the data plot and error bars respectively. Then you can set the color of each separately.
h = errorbar(x,y,e) %// a color spec here would affect both data and error bars
hc = get(h, 'Children')
set(hc(1),'color','b') %// data
set(hc(2),'color','g') %// error bars