@@ -407,7 +407,7 @@ def _get_clip_cmd(self, gc):
407
407
clip = []
408
408
rect = gc .get_clip_rectangle ()
409
409
if rect is not None :
410
- clip .append ("%s clipbox \n " % _nums_to_str (* rect .size , * rect .p0 ) )
410
+ clip .append (f" { _nums_to_str (* rect .p0 , * rect .size ) } rectclip \n " )
411
411
path , trf = gc .get_clip_path ()
412
412
if path is not None :
413
413
key = (path , id (trf ))
@@ -953,8 +953,7 @@ def print_figure_impl(fh):
953
953
print ("%s translate" % _nums_to_str (xo , yo ), file = fh )
954
954
if rotation :
955
955
print ("%d rotate" % rotation , file = fh )
956
- print ("%s clipbox" % _nums_to_str (width * 72 , height * 72 , 0 , 0 ),
957
- file = fh )
956
+ print (f"0 0 { _nums_to_str (width * 72 , height * 72 )} rectclip" , file = fh )
958
957
959
958
# write the figure
960
959
print (self ._pswriter .getvalue (), file = fh )
@@ -1038,7 +1037,7 @@ def _print_figure_tex(
1038
1037
%%EndProlog
1039
1038
mpldict begin
1040
1039
{ _nums_to_str (xo , yo )} translate
1041
- { _nums_to_str (width * 72 , height * 72 )} 0 0 clipbox
1040
+ 0 0 { _nums_to_str (width * 72 , height * 72 )} rectclip
1042
1041
{ self ._pswriter .getvalue ()}
1043
1042
end
1044
1043
showpage
@@ -1316,20 +1315,6 @@ def pstoeps(tmpfile, bbox=None, rotated=False):
1316
1315
"/cl { closepath } _d" ,
1317
1316
# *ce* -
1318
1317
"/ce { closepath eofill } _d" ,
1319
- # w h x y *box* -
1320
- """/box {
1321
- m
1322
- 1 index 0 r
1323
- 0 exch r
1324
- neg 0 r
1325
- cl
1326
- } _d""" ,
1327
- # w h x y *clipbox* -
1328
- """/clipbox {
1329
- box
1330
- clip
1331
- newpath
1332
- } _d""" ,
1333
1318
# wx wy llx lly urx ury *setcachedevice* -
1334
1319
"/sc { setcachedevice } _d" ,
1335
1320
]
0 commit comments