Nicely done - though I concur with previous problems concerning the height of tee for single points (or multiple points at the same y-value). My work around was to allow y to be longer than x, then clip y to y([1 : length(x)]), but this won't work for non-vector input.
@Juha, it is ill-advised to use legend that way. Better get the indices of the plots and use them to create a proper legend.
Also note that this function was written for ML13, and therefore returns 2 handles instead of 1. Use this to your advantage!
h1 = herrorbar(22, 20, 2.74, 'o')
hold on;
h2 = herrorbar(21, 26, 2.63, 'p')
legend([h1(2) h2(2) h2(1)],{'test1', 'test2','error of test2'})
Comment only