1
1
from __future__ import (absolute_import , division , print_function ,
2
2
unicode_literals )
3
3
4
+ from collections import OrderedDict
5
+
4
6
from matplotlib .externals import six
5
7
from matplotlib .externals .six .moves import xrange
6
8
from matplotlib .externals .six import unichr
7
9
8
10
import os , base64 , tempfile , gzip , io , sys , codecs , re
9
- from collections import OrderedDict
10
11
11
12
import numpy as np
12
13
17
18
from matplotlib .backend_bases import RendererBase , GraphicsContextBase ,\
18
19
FigureManagerBase , FigureCanvasBase
19
20
from matplotlib .backends .backend_mixed import MixedModeRenderer
20
- from matplotlib .cbook import (is_string_like , is_writable_file_like , maxdict ,
21
- sorted_iteritems , sorted_itervalues )
21
+ from matplotlib .cbook import is_string_like , is_writable_file_like , maxdict
22
22
from matplotlib .colors import rgb2hex
23
23
from matplotlib .figure import Figure
24
24
from matplotlib .font_manager import findfont , FontProperties , get_font
@@ -359,7 +359,7 @@ def _write_hatches(self):
359
359
HATCH_SIZE = 72
360
360
writer = self .writer
361
361
writer .start ('defs' )
362
- for ((path , face , stroke ), oid ) in sorted_itervalues (self ._hatchd ):
362
+ for ((path , face , stroke ), oid ) in six . itervalues (self ._hatchd ):
363
363
writer .start (
364
364
'pattern' ,
365
365
id = oid ,
@@ -470,7 +470,7 @@ def _write_clips(self):
470
470
return
471
471
writer = self .writer
472
472
writer .start ('defs' )
473
- for clip , oid in sorted_itervalues (self ._clipd ):
473
+ for clip , oid in six . itervalues (self ._clipd ):
474
474
writer .start ('clipPath' , id = oid )
475
475
if len (clip ) == 2 :
476
476
clippath , clippath_trans = clip
@@ -489,7 +489,7 @@ def _write_svgfonts(self):
489
489
490
490
writer = self .writer
491
491
writer .start ('defs' )
492
- for font_fname , chars in sorted_iteritems (self ._fonts ):
492
+ for font_fname , chars in six . iteritems (self ._fonts ):
493
493
font = get_font (font_fname )
494
494
font .set_size (72 , 72 )
495
495
sfnt = font .get_sfnt ()
@@ -918,7 +918,7 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath, mtext=None):
918
918
919
919
if glyph_map_new :
920
920
writer .start ('defs' )
921
- for char_id , glyph_path in sorted_iteritems (glyph_map_new ):
921
+ for char_id , glyph_path in six . iteritems (glyph_map_new ):
922
922
path = Path (* glyph_path )
923
923
path_data = self ._convert_path (path , simplify = False )
924
924
writer .element ('path' , id = char_id , d = path_data )
@@ -961,7 +961,7 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath, mtext=None):
961
961
# used.
962
962
if glyph_map_new :
963
963
writer .start ('defs' )
964
- for char_id , glyph_path in sorted_iteritems (glyph_map_new ):
964
+ for char_id , glyph_path in six . iteritems (glyph_map_new ):
965
965
char_id = self ._adjust_char_id (char_id )
966
966
# Some characters are blank
967
967
if not len (glyph_path [0 ]):
@@ -1105,7 +1105,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None):
1105
1105
fontset = self ._fonts .setdefault (font .fname , set ())
1106
1106
fontset .add (thetext )
1107
1107
1108
- for style , chars in sorted_iteritems (spans ):
1108
+ for style , chars in six . iteritems (spans ):
1109
1109
chars .sort ()
1110
1110
1111
1111
same_y = True
0 commit comments