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
Next Next commit
get proper renderer width and height in FigureImage
  • Loading branch information
jklymak committed Sep 19, 2017
commit ed44f27ee16e2676f86c137768ba3afd4f1f6da8
3 changes: 2 additions & 1 deletion lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,8 @@ def get_extent(self):
def make_image(self, renderer, magnification=1.0, unsampled=False):
bbox = Bbox([[self.ox, self.oy],
[self.ox + self._A.shape[1], self.oy + self._A.shape[0]]])
clip = Bbox([[0, 0], [renderer.width, renderer.height]])
width, height = renderer.get_canvas_width_height()
clip = Bbox([[0, 0], [width, height]])
return self._make_image(
self._A, bbox, bbox, clip, magnification=magnification,
unsampled=unsampled, round_to_pixel_border=False)
Expand Down