@@ -446,14 +446,12 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
446446 linewidths , linestyles , antialiaseds , urls ,
447447 offset_position )
448448
449- write = self ._pswriter .write
450-
451449 path_codes = []
452450 for i , (path , transform ) in enumerate (self ._iter_collection_raw_paths (
453451 master_transform , paths , all_transforms )):
454452 name = 'p%x_%x' % (self ._path_collection_id , i )
455453 path_bytes = self ._convert_path (path , transform , simplify = False )
456- write (f"""\
454+ self . _pswriter . write (f"""\
457455 /{ name } {{
458456newpath
459457translate
@@ -510,10 +508,8 @@ def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
510508 def draw_text (self , gc , x , y , s , prop , angle , ismath = False , mtext = None ):
511509 # docstring inherited
512510
513- # local to avoid repeated attribute lookups
514- write = self ._pswriter .write
515511 if debugPS :
516- write ("% text\n " )
512+ self . _pswriter . write ("% text\n " )
517513
518514 if _is_transparent (gc .get_rgb ()):
519515 return # Special handling for fully transparent.
@@ -941,10 +937,7 @@ def print_figure_impl(fh):
941937 file = fh )
942938
943939 # 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 )
948941
949942 # write the trailer
950943 print ("end" , file = fh )
0 commit comments