Skip to content

Commit f9c9ca7

Browse files
committed
Don't try to re-setup any GUI event loop
1 parent 8eeecf4 commit f9c9ca7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/init.jl

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ function find_backend(matplotlib::PyObject)
7070

7171
qt2gui = Dict("pyqt5"=>:qt_pyqt5, "pyqt4"=>:qt_pyqt4, "pyside"=>:qt_pyside)
7272

73+
if haskey(matplotlib, :pyplot)
74+
# If matplotlib.pyplot exists, it means that matplotlib
75+
# backend is already configured. It may mean that PyPlot.jl
76+
# is called via PyJulia.
77+
backend = lowercase(matplotlib[:get_backend]())
78+
return (backend, get(matplotlib2gui, backend, :none))
79+
end
80+
7381
rcParams = PyDict(matplotlib["rcParams"])
7482
default = lowercase(get(ENV, "MPLBACKEND",
7583
getnone(rcParams, "backend", "none")))

0 commit comments

Comments
 (0)