@@ -2097,13 +2097,6 @@ def make_iterable(x):
20972097 if yerr is not None :
20982098 yerr = self .convert_yunits (yerr )
20992099
2100- margins = {}
2101-
2102- if orientation == 'vertical' :
2103- margins = {'bottom' : False }
2104- elif orientation == 'horizontal' :
2105- margins = {'left' : False }
2106-
21072100 if align == 'center' :
21082101 if orientation == 'vertical' :
21092102 left = [left [i ] - width [i ] / 2. for i in xrange (len (left ))]
@@ -2128,11 +2121,13 @@ def make_iterable(x):
21282121 edgecolor = e ,
21292122 linewidth = lw ,
21302123 label = '_nolegend_' ,
2131- margins = margins
21322124 )
21332125 r .update (kwargs )
21342126 r .get_path ()._interpolation_steps = 100
2135- #print r.get_label(), label, 'label' in kwargs
2127+ if orientation == 'vertical' :
2128+ r .stickies .y .append (0 )
2129+ elif orientation == 'horizontal' :
2130+ r .stickies .x .append (0 )
21362131 self .add_patch (r )
21372132 patches .append (r )
21382133
@@ -5452,7 +5447,7 @@ def pcolor(self, *args, **kwargs):
54525447
54535448 kwargs .setdefault ('snap' , False )
54545449
5455- collection = mcoll .PolyCollection (verts , margins = False , ** kwargs )
5450+ collection = mcoll .PolyCollection (verts , ** kwargs )
54565451
54575452 collection .set_alpha (alpha )
54585453 collection .set_array (C )
@@ -5486,8 +5481,10 @@ def pcolor(self, *args, **kwargs):
54865481 miny = np .amin (y )
54875482 maxy = np .amax (y )
54885483
5489- corners = (minx , miny ), (maxx , maxy )
54905484 self .add_collection (collection , autolim = False )
5485+ corners = (minx , miny ), (maxx , maxy )
5486+ collection .stickies .x [:] = [minx , maxx ]
5487+ collection .stickies .y [:] = [miny , maxy ]
54915488 self .update_datalim (corners )
54925489 self .autoscale_view ()
54935490 return collection
@@ -5603,10 +5600,9 @@ def pcolormesh(self, *args, **kwargs):
56035600 coords [:, 0 ] = X
56045601 coords [:, 1 ] = Y
56055602
5606- collection = mcoll .QuadMesh (
5607- Nx - 1 , Ny - 1 , coords ,
5608- antialiased = antialiased , shading = shading , margins = False ,
5609- ** kwargs )
5603+ collection = mcoll .QuadMesh (Nx - 1 , Ny - 1 , coords ,
5604+ antialiased = antialiased , shading = shading ,
5605+ ** kwargs )
56105606 collection .set_alpha (alpha )
56115607 collection .set_array (C )
56125608 if norm is not None and not isinstance (norm , mcolors .Normalize ):
@@ -5637,8 +5633,10 @@ def pcolormesh(self, *args, **kwargs):
56375633 miny = np .amin (Y )
56385634 maxy = np .amax (Y )
56395635
5640- corners = (minx , miny ), (maxx , maxy )
56415636 self .add_collection (collection , autolim = False )
5637+ corners = (minx , miny ), (maxx , maxy )
5638+ collection .stickies .x [:] = [minx , maxx ]
5639+ collection .stickies .y [:] = [miny , maxy ]
56425640 self .update_datalim (corners )
56435641 self .autoscale_view ()
56445642 return collection
@@ -5790,8 +5788,7 @@ def pcolorfast(self, *args, **kwargs):
57905788 # The QuadMesh class can also be changed to
57915789 # handle relevant superclass kwargs; the initializer
57925790 # should do much more than it does now.
5793- collection = mcoll .QuadMesh (nc , nr , coords , 0 , edgecolors = "None" ,
5794- margins = False )
5791+ collection = mcoll .QuadMesh (nc , nr , coords , 0 , edgecolors = "None" )
57955792 collection .set_alpha (alpha )
57965793 collection .set_array (C )
57975794 collection .set_cmap (cmap )
@@ -5828,6 +5825,8 @@ def pcolorfast(self, *args, **kwargs):
58285825 ret .set_clim (vmin , vmax )
58295826 else :
58305827 ret .autoscale_None ()
5828+ collection .stickies .x [:] = [xl , xr ]
5829+ collection .stickies .y [:] = [yb , yt ]
58315830 self .update_datalim (np .array ([[xl , yb ], [xr , yt ]]))
58325831 self .autoscale_view (tight = True )
58335832 return ret
@@ -6240,21 +6239,17 @@ def _normalize_input(inp, ename='input'):
62406239 else :
62416240 n = [m [slc ].cumsum ()[slc ] for m in n ]
62426241
6243- if orientation == 'horizontal' :
6244- margins = {'left' : False }
6245- else :
6246- margins = {'bottom' : False }
6247-
62486242 patches = []
62496243
6244+ # Save autoscale state for later restoration; turn autoscaling
6245+ # off so we can do it all a single time at the end, instead
6246+ # of having it done by bar or fill and then having to be redone.
6247+ _saved_autoscalex = self .get_autoscalex_on ()
6248+ _saved_autoscaley = self .get_autoscaley_on ()
6249+ self .set_autoscalex_on (False )
6250+ self .set_autoscaley_on (False )
6251+
62506252 if histtype .startswith ('bar' ):
6251- # Save autoscale state for later restoration; turn autoscaling
6252- # off so we can do it all a single time at the end, instead
6253- # of having it done by bar or fill and then having to be redone.
6254- _saved_autoscalex = self .get_autoscalex_on ()
6255- _saved_autoscaley = self .get_autoscaley_on ()
6256- self .set_autoscalex_on (False )
6257- self .set_autoscaley_on (False )
62586253
62596254 totwidth = np .diff (bins )
62606255
@@ -6301,10 +6296,6 @@ def _normalize_input(inp, ename='input'):
63016296 bottom [:] = m
63026297 boffset += dw
63036298
6304- self .set_autoscalex_on (_saved_autoscalex )
6305- self .set_autoscaley_on (_saved_autoscaley )
6306- self .autoscale_view ()
6307-
63086299 elif histtype .startswith ('step' ):
63096300 # these define the perimeter of the polygon
63106301 x = np .zeros (4 * len (bins ) - 3 )
@@ -6384,8 +6375,13 @@ def _normalize_input(inp, ename='input'):
63846375 closed = True if fill else None ,
63856376 facecolor = c ,
63866377 edgecolor = None if fill else c ,
6387- fill = fill if fill else None ,
6388- margins = margins ))
6378+ fill = fill if fill else None ))
6379+ for patch_list in patches :
6380+ for patch in patch_list :
6381+ if orientation == 'vertical' :
6382+ patch .stickies .y .append (0 )
6383+ elif orientation == 'horizontal' :
6384+ patch .stickies .x .append (0 )
63896385
63906386 # we return patches, so put it back in the expected order
63916387 patches .reverse ()
@@ -6421,6 +6417,10 @@ def _normalize_input(inp, ename='input'):
64216417 ymin = min (ymin0 , ymin )
64226418 self .dataLim .intervaly = (ymin , ymax )
64236419
6420+ self .set_autoscalex_on (_saved_autoscalex )
6421+ self .set_autoscaley_on (_saved_autoscaley )
6422+ self .autoscale_view ()
6423+
64246424 if label is None :
64256425 labels = [None ]
64266426 elif is_string_like (label ):
0 commit comments