Skip to content

Commit

Permalink
Don't try to re-setup any GUI event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Aug 31, 2018
1 parent 8eeecf4 commit 4cbc792
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4cbc792

Please sign in to comment.