Fix print when matplot lib is invalid