@@ -2104,16 +2104,21 @@ def make_iterable(x):
21042104 if yerr is not None :
21052105 yerr = self .convert_yunits (yerr )
21062106
2107- if align == 'edge' :
2108- pass
2109- elif align == 'center' :
2107+ margins = {}
2108+
2109+ if orientation == 'vertical' :
2110+ margins = {'bottom' : False }
2111+ elif orientation == 'horizontal' :
2112+ margins = {'left' : False }
2113+
2114+ if align == 'center' :
21102115 if orientation == 'vertical' :
21112116 left = [left [i ] - width [i ] / 2. for i in xrange (len (left ))]
21122117 elif orientation == 'horizontal' :
21132118 bottom = [bottom [i ] - height [i ] / 2.
21142119 for i in xrange (len (bottom ))]
21152120
2116- else :
2121+ elif align != 'edge' :
21172122 raise ValueError ('invalid alignment: %s' % align )
21182123
21192124 args = zip (left , bottom , width , height , color , edgecolor , linewidth )
@@ -2129,7 +2134,8 @@ def make_iterable(x):
21292134 facecolor = c ,
21302135 edgecolor = e ,
21312136 linewidth = lw ,
2132- label = '_nolegend_'
2137+ label = '_nolegend_' ,
2138+ margins = margins
21332139 )
21342140 r .update (kwargs )
21352141 r .get_path ()._interpolation_steps = 100
@@ -5265,7 +5271,7 @@ def pcolor(self, *args, **kwargs):
52655271
52665272 kwargs .setdefault ('snap' , False )
52675273
5268- collection = mcoll .PolyCollection (verts , ** kwargs )
5274+ collection = mcoll .PolyCollection (verts , margins = False , ** kwargs )
52695275
52705276 collection .set_alpha (alpha )
52715277 collection .set_array (C )
@@ -5300,9 +5306,9 @@ def pcolor(self, *args, **kwargs):
53005306 maxy = np .amax (y )
53015307
53025308 corners = (minx , miny ), (maxx , maxy )
5309+ self .add_collection (collection , autolim = False )
53035310 self .update_datalim (corners )
53045311 self .autoscale_view ()
5305- self .add_collection (collection , autolim = False )
53065312 return collection
53075313
53085314 @unpack_labeled_data (label_namer = None )
@@ -5417,7 +5423,8 @@ def pcolormesh(self, *args, **kwargs):
54175423
54185424 collection = mcoll .QuadMesh (
54195425 Nx - 1 , Ny - 1 , coords ,
5420- antialiased = antialiased , shading = shading , ** kwargs )
5426+ antialiased = antialiased , shading = shading , margins = False ,
5427+ ** kwargs )
54215428 collection .set_alpha (alpha )
54225429 collection .set_array (C )
54235430 if norm is not None and not isinstance (norm , mcolors .Normalize ):
@@ -5449,9 +5456,9 @@ def pcolormesh(self, *args, **kwargs):
54495456 maxy = np .amax (Y )
54505457
54515458 corners = (minx , miny ), (maxx , maxy )
5459+ self .add_collection (collection , autolim = False )
54525460 self .update_datalim (corners )
54535461 self .autoscale_view ()
5454- self .add_collection (collection , autolim = False )
54555462 return collection
54565463
54575464 @unpack_labeled_data (label_namer = None )
@@ -5601,7 +5608,8 @@ def pcolorfast(self, *args, **kwargs):
56015608 # The QuadMesh class can also be changed to
56025609 # handle relevant superclass kwargs; the initializer
56035610 # should do much more than it does now.
5604- collection = mcoll .QuadMesh (nc , nr , coords , 0 , edgecolors = "None" )
5611+ collection = mcoll .QuadMesh (nc , nr , coords , 0 , edgecolors = "None" ,
5612+ margins = False )
56055613 collection .set_alpha (alpha )
56065614 collection .set_array (C )
56075615 collection .set_cmap (cmap )
@@ -5647,15 +5655,19 @@ def contour(self, *args, **kwargs):
56475655 if not self ._hold :
56485656 self .cla ()
56495657 kwargs ['filled' ] = False
5650- return mcontour .QuadContourSet (self , * args , ** kwargs )
5658+ contours = mcontour .QuadContourSet (self , * args , ** kwargs )
5659+ self .autoscale_view ()
5660+ return contours
56515661 contour .__doc__ = mcontour .QuadContourSet .contour_doc
56525662
56535663 @unpack_labeled_data ()
56545664 def contourf (self , * args , ** kwargs ):
56555665 if not self ._hold :
56565666 self .cla ()
56575667 kwargs ['filled' ] = True
5658- return mcontour .QuadContourSet (self , * args , ** kwargs )
5668+ contours = mcontour .QuadContourSet (self , * args , ** kwargs )
5669+ self .autoscale_view ()
5670+ return contours
56595671 contourf .__doc__ = mcontour .QuadContourSet .contour_doc
56605672
56615673 def clabel (self , CS , * args , ** kwargs ):
@@ -6035,6 +6047,11 @@ def hist(self, x, bins=None, range=None, normed=False, weights=None,
60356047 else :
60366048 n = [m [slc ].cumsum ()[slc ] for m in n ]
60376049
6050+ if orientation == 'horizontal' :
6051+ margins = {'left' : False }
6052+ else :
6053+ margins = {'bottom' : False }
6054+
60386055 patches = []
60396056
60406057 if histtype .startswith ('bar' ):
@@ -6175,14 +6192,16 @@ def hist(self, x, bins=None, range=None, normed=False, weights=None,
61756192 patches .append (self .fill (
61766193 x , y ,
61776194 closed = True ,
6178- facecolor = c ))
6195+ facecolor = c ,
6196+ margins = margins ))
61796197 else :
61806198 for x , y , c in reversed (list (zip (xvals , yvals , color ))):
61816199 split = 2 * len (bins )
61826200 patches .append (self .fill (
61836201 x [:split ], y [:split ],
61846202 closed = False , edgecolor = c ,
6185- fill = False ))
6203+ fill = False ,
6204+ margins = margins ))
61866205
61876206 # we return patches, so put it back in the expected order
61886207 patches .reverse ()
0 commit comments