@@ -315,6 +315,7 @@ def _print_vector(self, renderer_factory,
315315 def _print_ps_impl (self , is_eps , path_or_stream , * ,
316316 metadata = None , orientation = "portrait" , papertype = None ,
317317 ** kwargs ):
318+ # FIXME: papertype seems currently broken.
318319 if papertype is None :
319320 papertype = mpl .rcParams ["ps.papersize" ]
320321 if orientation == "portrait" :
@@ -342,11 +343,15 @@ def _print_ps_impl(self, is_eps, path_or_stream, *,
342343 with TemporaryDirectory () as tmp_dirname :
343344 tmp_name = Path (tmp_dirname , "tmp" )
344345 print_method (tmp_name , metadata = metadata , ** kwargs )
345- # Assume we can get away without passing the bbox.
346+ # Assume we can get away with just passing bbox width/height.
347+ wh = (self .figure .bbox .width , self .figure .bbox .height )
348+ if orientation == "landscape" :
349+ wh = wh [::- 1 ]
346350 {"ghostscript" : backend_ps .gs_distill ,
347351 "xpdf" : backend_ps .xpdf_distill }[
348352 mpl .rcParams ["ps.usedistiller" ]](
349- str (tmp_name ), is_eps , ptype = papertype )
353+ str (tmp_name ), is_eps , ptype = papertype ,
354+ bbox = (None , None , * wh ))
350355 # If path_or_stream is *already* a text-mode stream then
351356 # tmp_name needs to be opened in text-mode too.
352357 with cbook .open_file_cm (path_or_stream , "wb" ) as stream , \
0 commit comments