useful function for manipulating errorbars