@@ -446,14 +446,12 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
446
446
linewidths , linestyles , antialiaseds , urls ,
447
447
offset_position )
448
448
449
- write = self ._pswriter .write
450
-
451
449
path_codes = []
452
450
for i , (path , transform ) in enumerate (self ._iter_collection_raw_paths (
453
451
master_transform , paths , all_transforms )):
454
452
name = 'p%x_%x' % (self ._path_collection_id , i )
455
453
path_bytes = self ._convert_path (path , transform , simplify = False )
456
- write (f"""\
454
+ self . _pswriter . write (f"""\
457
455
/{ name } {{
458
456
newpath
459
457
translate
@@ -510,10 +508,8 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
510
508
def draw_text (self , gc , x , y , s , prop , angle , ismath = False , mtext = None ):
511
509
# docstring inherited
512
510
513
- # local to avoid repeated attribute lookups
514
- write = self ._pswriter .write
515
511
if debugPS :
516
- write ("% text\n " )
512
+ self . _pswriter . write ("% text\n " )
517
513
518
514
if _is_transparent (gc .get_rgb ()):
519
515
return # Special handling for fully transparent.
@@ -941,10 +937,7 @@ def print_figure_impl(fh):
941
937
file = fh )
942
938
943
939
# write the figure
944
- content = self ._pswriter .getvalue ()
945
- if not isinstance (content , str ):
946
- content = content .decode ('ascii' )
947
- print (content , file = fh )
940
+ print (self ._pswriter .getvalue (), file = fh )
948
941
949
942
# write the trailer
950
943
print ("end" , file = fh )
0 commit comments