diff --git a/src/init.jl b/src/init.jl index b564d9c3..529aa1d7 100644 --- a/src/init.jl +++ b/src/init.jl @@ -48,6 +48,13 @@ end # return (backend,gui) tuple function find_backend(matplotlib::PyObject) + if haskey(matplotlib, :pyplot) + # If matplotlib.pyplot exists, it means that matplotlib + # backend is configured. It may mean that PyPlot.jl is called + # via PyJulia. Don't setup any GUI event loop in this case. + return (matplotlib[:get_backend](), :none) + end + gui2matplotlib = Dict(:wx=>"WXAgg",:gtk=>"GTKAgg",:gtk3=>"GTK3Agg", :qt_pyqt4=>"Qt4Agg", :qt_pyqt5=>"Qt5Agg", :qt_pyside=>"Qt4Agg", :qt4=>"Qt4Agg",