function vherrorbar(x,y,sigx,sigy)



N = length(x);

linesize = 1;

marksize = 2;

barratio = .5;

for i = 1:N

    plot(x(i),y(i),'o','markersize',marksize); % plot data

    

    % horizontal errorbar

    plot([x(i)-sigx(i) x(i)+sigx(i)],...

         [y(i) y(i)],'linewidth',linesize); 

    plot([x(i)-sigx(i) x(i)-sigx(i)],...

         [y(i)+barratio*sigy(i) y(i)-barratio*sigy(i)]);

    plot([x(i)+sigx(i) x(i)+sigx(i)],...

         [y(i)+barratio*sigy(i) y(i)-barratio*sigy(i)]); 

    

    % vertical errorbar

    plot([x(i) x(i)],...

         [y(i)-sigy(i) y(i)+sigy(i)],'linewidth',linesize);

    plot([x(i)-barratio*sigx(i) x(i)+barratio*sigx(i)],...

         [y(i)-sigy(i) y(i)-sigy(i)]);

     plot([x(i)-barratio*sigx(i) x(i)+barratio*sigx(i)],...

         [y(i)+sigy(i) y(i)+sigy(i)]);

end