Skip to content

Commit fb71bf4

Browse files
committed
avoid accessing private member (was introduced with double-zoom patch)
svn path=/trunk/matplotlib/; revision=5493
1 parent ff7e6d8 commit fb71bf4

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

lib/matplotlib/axes.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5653,6 +5653,14 @@ def twiny(self):
56535653
ax2.xaxis.set_label_position('top')
56545654
self.xaxis.tick_bottom()
56555655
return ax2
5656+
5657+
def get_shared_x_axes(self):
5658+
'Return a copy of the shared axes Grouper object for x axes'
5659+
return self._shared_x_axes
5660+
5661+
def get_shared_y_axes(self):
5662+
'Return a copy of the shared axes Grouper object for y axes'
5663+
return self._shared_y_axes
56565664

56575665
#### Data analysis
56585666

@@ -5662,8 +5670,8 @@ def hist(self, x, bins=10, range=None, normed=False, cumulative=False,
56625670
"""
56635671
call signature::
56645672
5665-
hist(x, bins=10, normed=False, cumulative=False,
5666-
bottom=None, histtype='bar', align='edge',
5673+
hist(x, bins=10, range=None, normed=False, cumulative=False,
5674+
bottom=None, histtype='bar', align='mid',
56675675
orientation='vertical', rwidth=None, log=False, **kwargs)
56685676
56695677
Compute the histogram of x. The return value is (n, bins, patches) or
@@ -5673,7 +5681,6 @@ def hist(self, x, bins=10, range=None, normed=False, cumulative=False,
56735681
Keyword arguments:
56745682
56755683
bins:
5676-
56775684
either an integer number of bins or a sequence giving the
56785685
bins. x are the data to be binned. x can be an array or a
56795686
2D array with multiple data in its columns. Note, if bins
@@ -5884,8 +5891,8 @@ def hist(self, x, bins=10, range=None, normed=False, cumulative=False,
58845891
raise ValueError, 'invalid orientation: %s' % orientation
58855892

58865893
elif histtype.startswith('step'):
5887-
x = np.zeros( 2*len(bins), np.float_ )
5888-
y = np.zeros( 2*len(bins), np.float_ )
5894+
x = np.zeros( 2*len(bins), np.float )
5895+
y = np.zeros( 2*len(bins), np.float )
58895896

58905897
x[0::2], x[1::2] = bins, bins
58915898

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,8 +1767,8 @@ def release_zoom(self, event):
17671767
twinx, twiny = False, False
17681768
if last_a:
17691769
for la in last_a:
1770-
if a._shared_x_axes.joined(a,la): twinx=True
1771-
if a._shared_y_axes.joined(a,la): twiny=True
1770+
if a.get_shared_x_axes().joined(a,la): twinx=True
1771+
if a.get_shared_y_axes().joined(a,la): twiny=True
17721772
last_a.append(a)
17731773

17741774
if twinx:

0 commit comments

Comments
 (0)