Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions lib/matplotlib/backends/backend_cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import functools
import gzip
import itertools
import math

import numpy as np
Expand Down Expand Up @@ -249,15 +248,12 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
if angle:
ctx.rotate(np.deg2rad(-angle))

for (font, fontsize), font_glyphs in itertools.groupby(
glyphs, key=lambda info: (info[0], info[1])):
for font, fontsize, ccode, _glyph_index, ox, oy in glyphs:
ctx.new_path()
ctx.move_to(ox, -oy)
ctx.select_font_face(*_cairo_font_args_from_font_prop(ttfFontProperty(font)))
ctx.set_font_size(self.points_to_pixels(fontsize))
ctx.show_glyphs([
(glyph_index, ox, -oy)
for _font, _size, _ccode, glyph_index, ox, oy in font_glyphs
])
ctx.show_text(chr(ccode))

for ox, oy, w, h in rects:
ctx.new_path()
Expand Down
Loading