You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/init.jl
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,16 @@ function find_backend(matplotlib::PyObject)
112
112
if PyCall.gui ==:default
113
113
# try to ensure that GUI both exists and has a matplotlib backend
114
114
for (g,b) in options
115
+
if Sys.isapple() && g ==:tk&& default !="tkagg"&& conda
116
+
# tkagg backend crashes badly on MacOS
117
+
g, b =try
118
+
@info"Installing pyqt package to avoid buggy tkagg backend."
119
+
pyimport_conda("PyQt5", "pyqt")
120
+
:qt5, gui2matplotlib[:qt5]
121
+
catch
122
+
:none, "agg"
123
+
end
124
+
end
115
125
if g ==:none# Matplotlib is configured to be non-interactive
116
126
pygui(:default)
117
127
matplotlib."use"(b)
@@ -178,6 +188,9 @@ function __init__()
178
188
# workaround JuliaLang/julia#8925
179
189
global backend = backend_gui[1]
180
190
global gui = backend_gui[2]
191
+
if Sys.isapple() && gui ==:tk
192
+
@warn"PyPlot is using tkagg backend, which is known to cause crashes on MacOS (#410); use the MPLBACKEND environment variable to request a different backend."
193
+
end
181
194
182
195
copy!(plt, pyimport("matplotlib.pyplot")) # raw Python module
0 commit comments