Skip to content

Commit 71632ff

Browse files
committed
work around issue #278 (broken qt5agg on windows)
1 parent a62e9ff commit 71632ff

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/PyPlot.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,13 @@ function find_backend(matplotlib::PyObject)
121121
qt2gui = Dict("pyqt5"=>:qt_pyqt5, "pyqt4"=>:qt_pyqt4, "pyside"=>:qt_pyside)
122122

123123
rcParams = PyDict(matplotlib["rcParams"])
124-
default = lowercase(get(ENV, "MPLBACKEND",
125-
get(rcParams, "backend", "none")))
124+
default = lowercase(get(ENV, "MPLBACKEND", "none"))
125+
if default == "none"
126+
default = lowercase(get(rcParams, "backend", "none"))
127+
if is_windows() && default == "qt5agg"
128+
default = "qt4agg" # workaround issue #278
129+
end
130+
end
126131
if haskey(matplotlib2gui,default)
127132
defaultgui = matplotlib2gui[default]
128133

0 commit comments

Comments
 (0)