Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1155 from pwuertz/temp-tight-bbox-fix

workaround for fixed dpi assumption in adjust_bbox_pdf
  • Loading branch information...
commit 98927587681ef22f12a2f4c8cef879da7c8614b8 2 parents 50928d9 + 128b505
@mdboom mdboom authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/matplotlib/tight_bbox.py
View
8 lib/matplotlib/tight_bbox.py
@@ -88,7 +88,12 @@ def adjust_bbox_pdf(fig, bbox_inches):
adjust_bbox for pdf & eps format
"""
- tr = Affine2D().scale(72)
+ if fig._cachedRenderer.__class__.__name__ == "RendererPgf":
+ tr = Affine2D().scale(fig.dpi)
+ f = 1.
+ else:
+ tr = Affine2D().scale(72)
+ f = 72. / fig.dpi
_bbox = TransformedBbox(bbox_inches, tr)
@@ -96,7 +101,6 @@ def adjust_bbox_pdf(fig, bbox_inches):
bbox_inches.width,
bbox_inches.height)
x0, y0 = _bbox.x0, _bbox.y0
- f = 72. / fig.dpi
w1, h1 = fig.bbox.width*f, fig.bbox.height*f
fig.transFigure._boxout = Bbox.from_bounds(-x0, -y0,
w1, h1)
Please sign in to comment.
Something went wrong with that request. Please try again.