improved plotting functions in matlab script