Matplotlib Crashing tkinter Application

前端 未结 5 1365
滥情空心
滥情空心 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条回答
  •  -上瘾入骨i
    2020-12-01 05:06

    I am still getting crashes with this:

    import matplotlib
    matplotlib.use("TkAgg")
    import matplotlib.pyplot as plt
    import numpy as np
    
    x = np.linspace(0, 2 * np.pi, 400)
    y = np.sin(x ** 2)
    
    f = plt.figure()
    plt.plot(x, y)
    f.show()
    plt.pause(0.0001)
    

    The window with a sinappears and then the kernel freezes. Windows 10 with Anaconda3

提交回复
热议问题