function h=errorbar_CI(x,y,yCI,lineSpec)

% -------------------------------------------------------------------------
%   errorbar_CI(x,y,yCI,lineSpec)
%
%   A quick wrapper function for Matlab's errorbar. Instead of
%   errors with respect to y, the confidence intervals are input.
%
%   by Loes van Dam, 2014
%   Loes.van_Dam@uni-bielefeld.de
%
% -------------------------------------------------------------------------

% check if right format
sy = size(y);
if sy(2)> sy(1),
    % transpose
    y = y';
    yCI = yCI';
end

errBar = [y-yCI(:,1),yCI(:,2) - y];



h = errorbar(x,y,errBar(:,1),errBar(:,2),lineSpec);