File tree 2 files changed +14
-2
lines changed 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -853,8 +853,9 @@ def make_image(self, magnification=1.0):
853
853
l , b , r , t = self .axes .bbox .extents
854
854
width = (round (r ) + 0.5 ) - (round (l ) - 0.5 )
855
855
height = (round (t ) + 0.5 ) - (round (b ) - 0.5 )
856
- width = width * magnification
857
- height = height * magnification
856
+ # The extra cast-to-int is only needed for python2
857
+ width = int (round (width * magnification ))
858
+ height = int (round (height * magnification ))
858
859
if self ._rgbacache is None :
859
860
A = self .to_rgba (self ._A , bytes = True )
860
861
self ._rgbacache = A
Original file line number Diff line number Diff line change @@ -3668,6 +3668,17 @@ def test_bar_negative_width():
3668
3668
assert_equal (b ._height , indx + 1 )
3669
3669
3670
3670
3671
+ @cleanup
3672
+ def test_pcolor_fast_non_uniform ():
3673
+ Z = np .arange (6 ).reshape ((3 , 2 ))
3674
+ X = np .array ([0 , 1 , 2 , 10 ])
3675
+ Y = np .array ([0 , 1 , 2 ])
3676
+
3677
+ plt .figure ()
3678
+ ax = plt .subplot (111 )
3679
+ ax .pcolorfast (X , Y , Z .T )
3680
+
3681
+
3671
3682
if __name__ == '__main__' :
3672
3683
import nose
3673
3684
import sys
You can’t perform that action at this time.
0 commit comments