diff --git a/kwant/tests/test_plotter.py b/kwant/tests/test_plotter.py
index 2678923d799f738f9623420ab41427f2d8e7cf1f..c933d34b51d6dea9ca63e37364b88a8c8252313b 100644
--- a/kwant/tests/test_plotter.py
+++ b/kwant/tests/test_plotter.py
@@ -38,6 +38,7 @@ except ImportError:
 from kwant import plotter
 
 
+@pytest.mark.skipif(not plotter.mpl_available, reason="Matplotlib unavailable.")
 def test_matplotlib_backend_unset():
     """Simply importing Kwant should not set the matplotlib backend."""
     assert matplotlib_backend_chosen is False