6
6
from matplotlib .externals .six import unichr
7
7
8
8
import os , base64 , tempfile , gzip , io , sys , codecs , re
9
+ from collections import OrderedDict
9
10
10
11
import numpy as np
11
12
@@ -263,15 +264,15 @@ def __init__(self, width, height, svgwriter, basename=None, image_dpi=72):
263
264
assert basename is not None
264
265
self .basename = basename
265
266
self ._imaged = {}
266
- self ._clipd = {}
267
+ self ._clipd = OrderedDict ()
267
268
self ._char_defs = {}
268
269
self ._markers = {}
269
270
self ._path_collection_id = 0
270
271
self ._imaged = {}
271
- self ._hatchd = {}
272
+ self ._hatchd = OrderedDict ()
272
273
self ._has_gouraud = False
273
274
self ._n_gradients = 0
274
- self ._fonts = {}
275
+ self ._fonts = OrderedDict ()
275
276
self .mathtext_parser = MathTextParser ('SVG' )
276
277
277
278
RendererBase .__init__ (self )
@@ -1087,7 +1088,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None):
1087
1088
1088
1089
# Sort the characters by font, and output one tspan for
1089
1090
# each
1090
- spans = {}
1091
+ spans = OrderedDict ()
1091
1092
for font , fontsize , thetext , new_x , new_y , metrics in svg_glyphs :
1092
1093
style = generate_css ({
1093
1094
'font-size' : six .text_type (fontsize ) + 'px' ,
@@ -1103,7 +1104,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None):
1103
1104
fontset = self ._fonts .setdefault (font .fname , set ())
1104
1105
fontset .add (thetext )
1105
1106
1106
- for style , chars in list ( six .iteritems (spans ) ):
1107
+ for style , chars in six .iteritems (spans ):
1107
1108
chars .sort ()
1108
1109
1109
1110
same_y = True
0 commit comments