@@ -2097,13 +2097,6 @@ def make_iterable(x):
2097
2097
if yerr is not None :
2098
2098
yerr = self .convert_yunits (yerr )
2099
2099
2100
- margins = {}
2101
-
2102
- if orientation == 'vertical' :
2103
- margins = {'bottom' : False }
2104
- elif orientation == 'horizontal' :
2105
- margins = {'left' : False }
2106
-
2107
2100
if align == 'center' :
2108
2101
if orientation == 'vertical' :
2109
2102
left = [left [i ] - width [i ] / 2. for i in xrange (len (left ))]
@@ -2128,11 +2121,13 @@ def make_iterable(x):
2128
2121
edgecolor = e ,
2129
2122
linewidth = lw ,
2130
2123
label = '_nolegend_' ,
2131
- margins = margins
2132
2124
)
2133
2125
r .update (kwargs )
2134
2126
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 )
2136
2131
self .add_patch (r )
2137
2132
patches .append (r )
2138
2133
@@ -5452,7 +5447,7 @@ def pcolor(self, *args, **kwargs):
5452
5447
5453
5448
kwargs .setdefault ('snap' , False )
5454
5449
5455
- collection = mcoll .PolyCollection (verts , margins = False , ** kwargs )
5450
+ collection = mcoll .PolyCollection (verts , ** kwargs )
5456
5451
5457
5452
collection .set_alpha (alpha )
5458
5453
collection .set_array (C )
@@ -5486,8 +5481,10 @@ def pcolor(self, *args, **kwargs):
5486
5481
miny = np .amin (y )
5487
5482
maxy = np .amax (y )
5488
5483
5489
- corners = (minx , miny ), (maxx , maxy )
5490
5484
self .add_collection (collection , autolim = False )
5485
+ corners = (minx , miny ), (maxx , maxy )
5486
+ collection .stickies .x [:] = [minx , maxx ]
5487
+ collection .stickies .y [:] = [miny , maxy ]
5491
5488
self .update_datalim (corners )
5492
5489
self .autoscale_view ()
5493
5490
return collection
@@ -5603,10 +5600,9 @@ def pcolormesh(self, *args, **kwargs):
5603
5600
coords [:, 0 ] = X
5604
5601
coords [:, 1 ] = Y
5605
5602
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 )
5610
5606
collection .set_alpha (alpha )
5611
5607
collection .set_array (C )
5612
5608
if norm is not None and not isinstance (norm , mcolors .Normalize ):
@@ -5637,8 +5633,10 @@ def pcolormesh(self, *args, **kwargs):
5637
5633
miny = np .amin (Y )
5638
5634
maxy = np .amax (Y )
5639
5635
5640
- corners = (minx , miny ), (maxx , maxy )
5641
5636
self .add_collection (collection , autolim = False )
5637
+ corners = (minx , miny ), (maxx , maxy )
5638
+ collection .stickies .x [:] = [minx , maxx ]
5639
+ collection .stickies .y [:] = [miny , maxy ]
5642
5640
self .update_datalim (corners )
5643
5641
self .autoscale_view ()
5644
5642
return collection
@@ -5790,8 +5788,7 @@ def pcolorfast(self, *args, **kwargs):
5790
5788
# The QuadMesh class can also be changed to
5791
5789
# handle relevant superclass kwargs; the initializer
5792
5790
# 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" )
5795
5792
collection .set_alpha (alpha )
5796
5793
collection .set_array (C )
5797
5794
collection .set_cmap (cmap )
@@ -5828,6 +5825,8 @@ def pcolorfast(self, *args, **kwargs):
5828
5825
ret .set_clim (vmin , vmax )
5829
5826
else :
5830
5827
ret .autoscale_None ()
5828
+ collection .stickies .x [:] = [xl , xr ]
5829
+ collection .stickies .y [:] = [yb , yt ]
5831
5830
self .update_datalim (np .array ([[xl , yb ], [xr , yt ]]))
5832
5831
self .autoscale_view (tight = True )
5833
5832
return ret
@@ -6240,21 +6239,17 @@ def _normalize_input(inp, ename='input'):
6240
6239
else :
6241
6240
n = [m [slc ].cumsum ()[slc ] for m in n ]
6242
6241
6243
- if orientation == 'horizontal' :
6244
- margins = {'left' : False }
6245
- else :
6246
- margins = {'bottom' : False }
6247
-
6248
6242
patches = []
6249
6243
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
+
6250
6252
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 )
6258
6253
6259
6254
totwidth = np .diff (bins )
6260
6255
@@ -6301,10 +6296,6 @@ def _normalize_input(inp, ename='input'):
6301
6296
bottom [:] = m
6302
6297
boffset += dw
6303
6298
6304
- self .set_autoscalex_on (_saved_autoscalex )
6305
- self .set_autoscaley_on (_saved_autoscaley )
6306
- self .autoscale_view ()
6307
-
6308
6299
elif histtype .startswith ('step' ):
6309
6300
# these define the perimeter of the polygon
6310
6301
x = np .zeros (4 * len (bins ) - 3 )
@@ -6384,8 +6375,13 @@ def _normalize_input(inp, ename='input'):
6384
6375
closed = True if fill else None ,
6385
6376
facecolor = c ,
6386
6377
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 )
6389
6385
6390
6386
# we return patches, so put it back in the expected order
6391
6387
patches .reverse ()
@@ -6421,6 +6417,10 @@ def _normalize_input(inp, ename='input'):
6421
6417
ymin = min (ymin0 , ymin )
6422
6418
self .dataLim .intervaly = (ymin , ymax )
6423
6419
6420
+ self .set_autoscalex_on (_saved_autoscalex )
6421
+ self .set_autoscaley_on (_saved_autoscaley )
6422
+ self .autoscale_view ()
6423
+
6424
6424
if label is None :
6425
6425
labels = [None ]
6426
6426
elif is_string_like (label ):
0 commit comments