improved plotting functions