Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad25c0d

Browse files
author
Steve Chaplin
committed
'SC'
svn path=/trunk/matplotlib/; revision=1688
1 parent 547b5fe commit ad25c0d

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

lib/matplotlib/backends/backend_cairo.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,10 @@ def _save_ps_pdf (self, figure, filename, ext, orientation):
600600
surface = cairo.PDFSurface (filename, width_in_points,
601601
height_in_points)
602602
# surface.set_dpi() can be used
603-
# FIXME - use self._renderer?
604-
renderer._set_ctx_from_surface (surface)
603+
renderer = RendererCairo (figure.dpi)
604+
renderer.set_ctx_from_surface (surface)
605+
renderer.set_width_height (width_in_points, height_in_points)
606+
ctx = renderer.ctx
605607

606608
if orientation == 'landscape':
607609
ctx.rotate (numx.pi/2)
@@ -613,9 +615,6 @@ def _save_ps_pdf (self, figure, filename, ext, orientation):
613615
# TODO:
614616
# add portrait/landscape checkbox to FileChooser
615617

616-
renderer = RendererCairo (figure.dpi)
617-
renderer._set_width_height (width_in_points, height_in_points)
618-
renderer.surface = surface
619618
figure.draw (renderer)
620619

621620
show_fig_border = False # for testing figure orientation and scaling

0 commit comments

Comments
 (0)