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

Skip to content

Get proper renderer width and height in FigureImage #9204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 24, 2017
Prev Previous commit
Next Next commit
Put a bit of commenting in
  • Loading branch information
jklymak committed Sep 20, 2017
commit 90aab86d029f3073d23930c7b83edb25a15b05c6
3 changes: 3 additions & 0 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,9 @@ def get_extent(self):

def make_image(self, renderer, magnification=1.0, unsampled=False):
fac = renderer.dpi/self.figure.dpi
# fac here is to account for pdf, eps, svg backends where
# figure.dpi is set to 72. This means we need to scale the
# image (using magification) and offset it appropriately.
bbox = Bbox([[self.ox/fac, self.oy/fac],
[(self.ox/fac + self._A.shape[1]),
(self.oy/fac + self._A.shape[0])]])
Expand Down