From a0ce9f142014cb35de03e2760cc0be0c06ed27c4 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 18 Mar 2014 09:40:13 -0400 Subject: [PATCH] Fix Cairo text on Python3 with pycairo --- lib/matplotlib/backends/backend_cairo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_cairo.py b/lib/matplotlib/backends/backend_cairo.py index 8c46277bbcb9..952b879d2c7e 100644 --- a/lib/matplotlib/backends/backend_cairo.py +++ b/lib/matplotlib/backends/backend_cairo.py @@ -212,7 +212,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None): if not isinstance(s, six.text_type): s = six.text_type(s) else: - if isinstance(s, six.text_type): + if not six.PY3 and isinstance(s, six.text_type): s = s.encode("utf-8") ctx.show_text(s)