reducing matplotlib dependence