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

Skip to content
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