new solution to matplotlib interactive display problem