make matplotlib work without display