@@ -650,10 +650,10 @@ def make_image(self, magnification=1.0):
650650 im .apply_translation (tx , ty )
651651
652652 l , b , r , t = self .axes .bbox .extents
653- widthDisplay = ((round (r * magnification ) + 0.5 ) -
654- (round (l * magnification ) - 0.5 ))
655- heightDisplay = ((round (t * magnification ) + 0.5 ) -
656- (round (b * magnification ) - 0.5 ))
653+ widthDisplay = ((np . round (r * magnification ) + 0.5 ) -
654+ (np . round (l * magnification ) - 0.5 ))
655+ heightDisplay = ((np . round (t * magnification ) + 0.5 ) -
656+ (np . round (b * magnification ) - 0.5 ))
657657
658658 # resize viewport to display
659659 rx = widthDisplay / numcols
@@ -773,8 +773,8 @@ def make_image(self, magnification=1.0):
773773
774774 x0 , y0 , v_width , v_height = self .axes .viewLim .bounds
775775 l , b , r , t = self .axes .bbox .extents
776- width = (round (r ) + 0.5 ) - (round (l ) - 0.5 )
777- height = (round (t ) + 0.5 ) - (round (b ) - 0.5 )
776+ width = (np . round (r ) + 0.5 ) - (np . round (l ) - 0.5 )
777+ height = (np . round (t ) + 0.5 ) - (np . round (b ) - 0.5 )
778778 width *= magnification
779779 height *= magnification
780780 im = _image .pcolor (self ._Ax , self ._Ay , A ,
@@ -897,11 +897,11 @@ def make_image(self, magnification=1.0):
897897 bg = mcolors .colorConverter .to_rgba (fc , 0 )
898898 bg = (np .array (bg )* 255 ).astype (np .uint8 )
899899 l , b , r , t = self .axes .bbox .extents
900- width = (round (r ) + 0.5 ) - (round (l ) - 0.5 )
901- height = (round (t ) + 0.5 ) - (round (b ) - 0.5 )
900+ width = (np . round (r ) + 0.5 ) - (np . round (l ) - 0.5 )
901+ height = (np . round (t ) + 0.5 ) - (np . round (b ) - 0.5 )
902902 # The extra cast-to-int is only needed for python2
903- width = int (round (width * magnification ))
904- height = int (round (height * magnification ))
903+ width = int (np . round (width * magnification ))
904+ height = int (np . round (height * magnification ))
905905 if self ._rgbacache is None :
906906 A = self .to_rgba (self ._A , bytes = True )
907907 self ._rgbacache = A
@@ -932,8 +932,8 @@ def draw(self, renderer, *args, **kwargs):
932932 gc .set_clip_path (self .get_clip_path ())
933933 gc .set_alpha (self .get_alpha ())
934934 renderer .draw_image (gc ,
935- round (self .axes .bbox .xmin ),
936- round (self .axes .bbox .ymin ),
935+ np . round (self .axes .bbox .xmin ),
936+ np . round (self .axes .bbox .ymin ),
937937 im )
938938 gc .restore ()
939939 self .stale = False
@@ -1093,7 +1093,7 @@ def draw(self, renderer, *args, **kwargs):
10931093 gc .set_clip_rectangle (self .figure .bbox )
10941094 gc .set_clip_path (self .get_clip_path ())
10951095 gc .set_alpha (self .get_alpha ())
1096- renderer .draw_image (gc , round (self .ox ), round (self .oy ), im )
1096+ renderer .draw_image (gc , np . round (self .ox ), np . round (self .oy ), im )
10971097 gc .restore ()
10981098 self .stale = False
10991099
@@ -1212,8 +1212,8 @@ def make_image(self, renderer, magnification=1.0):
12121212 im .set_resample (self ._resample )
12131213
12141214 l , b , r , t = self .get_window_extent (renderer ).extents # bbox.extents
1215- widthDisplay = abs (round (r ) - round (l ))
1216- heightDisplay = abs (round (t ) - round (b ))
1215+ widthDisplay = abs (np . round (r ) - np . round (l ))
1216+ heightDisplay = abs (np . round (t ) - np . round (b ))
12171217 widthDisplay *= magnification
12181218 heightDisplay *= magnification
12191219
@@ -1245,7 +1245,7 @@ def draw(self, renderer, *args, **kwargs):
12451245
12461246 l = np .min ([x0 , x1 ])
12471247 b = np .min ([y0 , y1 ])
1248- renderer .draw_image (gc , round (l ), round (b ), im )
1248+ renderer .draw_image (gc , np . round (l ), np . round (b ), im )
12491249 gc .restore ()
12501250 self .stale = True
12511251
0 commit comments