8000 fixed broken xaxis_date and yaxis_date · matplotlib/matplotlib@92ca119 · GitHub
[go: up one dir, main page]

Skip to content

Commit 92ca119

Browse files
committed
fixed broken xaxis_date and yaxis_date
svn path=/trunk/matplotlib/; revision=3021
1 parent 4c6b6f5 commit 92ca119

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

examples/barcode_demo.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from pylab import figure, show, cm, nx
22

33
# the bar
4-
x = nx.mlab.rand(500)
5-
x[x>0.7] = 1.
6-
x[x<=0.7] = 0.
4+
x = nx.where(nx.mlab.rand(500)>0.7, 1.0, 0.0)
75

86
axprops = dict(xticks=[], yticks=[])
97
barprops = dict(aspect='auto', cmap=cm.binary, interpolation='nearest')
@@ -15,7 +13,6 @@
1513
ax = fig.add_axes([0.1, 0.3, 0.1, 0.6], **axprops)
1614
ax.imshow(x, **barprops)
1715

18-
1916
# a horizontal barcode
2017
x.shape = 1, len(x)
2118
ax = fig.add_axes([0.3, 0.1, 0.6, 0.1], **axprops)

lib/matplotlib/axes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,13 +1554,13 @@ def xaxis_date(self, tz=None):
15541554
tz is the time zone to use in labeling dates. Defaults to rc value.
15551555
"""
15561556

1557-
thislocator = self.xaxis.get_major_locator()
1558-
if not isinstance(thislocator, DateLocator):
1557+
locator = self.xaxis.get_major_locator()
1558+
if not isinstance(locator, DateLocator):
15591559
locator = AutoDateLocator(tz)
15601560
self.xaxis.set_major_locator(locator)
15611561

1562-
thisformatter = self.xaxis.get_major_formatter()
1563-
if not isinstance(thisformatter, DateFormatter):
1562+
formatter = self.xaxis.get_major_formatter()
1563+
if not isinstance(formatter, DateFormatter):
15641564
formatter = AutoDateFormatter(locator)
15651565
self.xaxis.set_major_formatter(formatter)
15661566

@@ -1570,13 +1570,13 @@ def yaxis_date(self, tz=None):
15701570
tz is the time zone to use in labeling dates. Defaults to rc value.
15711571
"""
15721572

1573-
thislocator = self.yaxis.get_major_locator()
1574-
if not isinstance(thislocator, DateLocator):
1573+
locator = self.yaxis.get_major_locator()
1574+
if not isinstance(locator, DateLocator):
15751575
locator = AutoDateLocator(tz)
15761576
self.yaxis.set_major_locator(locator)
15771577

1578-
thisformatter = self.xaxis.get_major_formatter()
1579-
if not isinstance(thisformatter, DateFormatter):
1578+
formatter = self.xaxis.get_major_formatter()
1579+
if not isinstance(formatter, DateFormatter):
15801580
formatter = AutoDateFormatter(locator)
15811581
self.yaxis.set_major_formatter(formatter)
15821582

0 commit comments

Comments
 (0)
0