diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py index 0aaeb0ae22f..199fa6864cc 100644 --- a/src/sage/plot/graphics.py +++ b/src/sage/plot/graphics.py @@ -3381,11 +3381,12 @@ def save(self, filename, **kwds): if latex_implementations[0] == "pdflatex": # use pdflatex and set font encoding as per # matplotlib documentation: - # https://matplotlib.org/users/pgf.html#pgf-tutorial + # https://matplotlib.org/stable/users/explain/text/pgf.html + # Note that pgf.preamble should be a string now, not a list pgf_options = {"pgf.texsystem": "pdflatex", - "pgf.preamble": [ + "pgf.preamble": "\n".join([ r"\usepackage[utf8x]{inputenc}", - r"\usepackage[T1]{fontenc}"]} + r"\usepackage[T1]{fontenc}"])} else: pgf_options = { "pgf.texsystem": latex_implementations[0],