function [fX, fY] = stairs_centered(X,Y,varargin)

Y_ext = [Y; Y(end,:)];
X_ext = [X - (X(2)-X(1))/2 , X(end) + (X(2)- X(1))/2 ];

[fX, fY] = stairs(X_ext, Y_ext, varargin{:});

end