diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 876d69ef6ccc..33a1908f6f51 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -340,7 +340,7 @@ def get_width_height_descent(self, text, prop): # parse metrics from the answer string try: - width, height, offset = answer.split("\n")[0].split(",") + width, height, offset = answer.splitlines()[0].split(",") except: msg = "Error processing '%s'\nLaTeX Output:\n%s" % (text, answer) raise ValueError(msg)