diff --git a/bob/bio/base/script/evaluate.py b/bob/bio/base/script/evaluate.py
index 2d1ba1ebfcf0b519634fca64cc76de517612d9a2..562c5956357481b064f846e43b5d74f4d83288f5 100644
--- a/bob/bio/base/script/evaluate.py
+++ b/bob/bio/base/script/evaluate.py
@@ -11,7 +11,7 @@ from __future__ import print_function
 # matplotlib stuff
 import matplotlib
 from matplotlib import pyplot
-pyplot.ioff() # turn off interactive mode -- no figure window will be shown
+pyplot.switch_backend('agg')  # switch to non-X backend
 from matplotlib.backends.backend_pdf import PdfPages
 
 # import bob.measure after matplotlib, so that it cannot define the backend