diff --git a/pyproject.toml b/pyproject.toml
index f1ee514f..5a8453b0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -29,7 +29,7 @@ keywords = ["latex", "tikz", "matplotlib", "graphics"]
 dynamic = ["version"]
 requires-python = ">=3.7"
 dependencies = [
-  "matplotlib >= 1.4.0",
+  "matplotlib >= 1.4.0, < 3.8",
   "numpy",
   "Pillow",
   "webcolors",