Skip to content

Commit 4cbc792

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

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/init.jl

+7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ end
4848

4949
# return (backend,gui) tuple
5050
function find_backend(matplotlib::PyObject)
51+
if haskey(matplotlib, :pyplot)
52+
# If matplotlib.pyplot exists, it means that matplotlib
53+
# backend is configured. It may mean that PyPlot.jl is called
54+
# via PyJulia. Don't setup any GUI event loop in this case.
55+
return (matplotlib[:get_backend](), :none)
56+
end
57+
5158
gui2matplotlib = Dict(:wx=>"WXAgg",:gtk=>"GTKAgg",:gtk3=>"GTK3Agg",
5259
:qt_pyqt4=>"Qt4Agg", :qt_pyqt5=>"Qt5Agg",
5360
:qt_pyside=>"Qt4Agg", :qt4=>"Qt4Agg",

0 commit comments

Comments
 (0)