Hi, I am trying to plot 21 points and attached error bars in two different colours with the first 11 points and error bars being green and the next 10 being blue. This is as they show different results, as one is when the voltage is increased and the other is for when it is decreased.
The data points themselves do the correct thing, but the errorbars change colour with every loop.
I think I need to individually change the colour of the error bars but I can't seem to find a way to do that, I have attached the output graph, please could someone help :(
err = sqrt((abs(y-yfit)).^2);
errorbar(x(i),y(i),err(i),'o', 'LineWidth', 2, 'MarkerFaceColor','g');
errorbar(x(i),y(i), err(i),'o', 'LineWidth', 2, 'MarkerFaceColor','b')
plot(x, yfit, '-r','LineWidth', 2)