Matplotlib Crashing tkinter Application

前端 未结 5 1373
滥情空心
滥情空心 2020-12-01 04:34

I am building an application that embeds a matplotlib figure into the GUI. The problem is that my app is crashing as soon as I add anything from matplotlib into my code (ex

5条回答
  •  悲哀的现实
    2020-12-01 05:23

    @DonCristobal's answer helped me and therefore I tried to upvote or add a comment to it but stackoverflow prevents me from doing any of that citing certain points I must reach before I can comment or upvote. The solution suggested by @DonCristobal worked for my configuration given below:

    Mac catalina, python 3.6 & matplotlib 3.0.3

    Here is what i did -

    Modified

    import matplotlib.pyplot as plt
    

    to

    import matplotlib
    
    matplotlib.use("TkAgg")
    
    from matplotlib import pyplot as plt
    

提交回复
热议问题