function h=shadedErrorBar_CI(x,y,yCI,lineProps,transparent)

% -------------------------------------------------------------------------
%   shadedErrorBar_CI(x,y,errBar,lineProps,transparent)
%
%   A quick wrapper function for Rob Campbell's shadedErrorBar. Instead of
%   errors with respect to y, the confidence intervals are input
%
%   by Loes van Dam, 2014
%   Loes.van_Dam@uni-bielefeld.de
%
% -------------------------------------------------------------------------

defaultProps={'-k'};
if nargin<4 || isempty(lineProps)
    lineProps=defaultProps; 
end
if ~iscell(lineProps)
    lineProps={lineProps}; 
end


if nargin<5 || ~isnumeric(transparent)
    transparent=0; 
end

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

% shadedErrorbar expects first the upper than the lower, so we need to swap
% the two columns
errBar = [yCI(:,2) - y,y-yCI(:,1)];

shadedErrorBar(x,y,errBar',lineProps,transparent);