简体   繁体   English

尝试使用 TkAgg 后端绘图时 Mac OS 崩溃

[英]Mac OS crashing when trying to plot using TkAgg backend

My computer logs me out ("crashes") when I try to plot using the TkAgg backend (see example below).当我尝试使用 TkAgg 后端进行绘图时,我的计算机将我注销(“崩溃”)(参见下面的示例)。 I am using mojave 10.14.6 and python 3.7.3.我正在使用莫哈韦沙漠 10.14.6 和 python 3.7.3。

from sys import platform as sys_pf
if sys_pf == 'darwin':
    import matplotlib
    matplotlib.use("TkAgg")
x = [1,2,3]
# up to here the code does not cause a crash
plt.figure()
pl.plot(x)
plt.show()

Having a similar issue.有类似的问题。 The only fix I have now is to use我现在唯一的解决方法是使用

matplotlib.use("MacOSX")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM