简体   繁体   中英

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). I am using mojave 10.14.6 and 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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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