Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db01685

Browse filesBrowse files
committed
FIX: convert to use numpy floor/ceil
closes #6301
1 parent 40b01b6 commit db01685
Copy full SHA for db01685

File tree

Expand file treeCollapse file tree

2 files changed

+11
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-4
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,11 +1800,11 @@ def test_boxplot_sym():
18001800
def test_boxplot_autorange_whiskers():
18011801
x = np.ones(140)
18021802
x = np.hstack([0, x, 2])
1803-
1803+
18041804
fig1, ax1 = plt.subplots()
18051805
ax1.boxplot([x, x], bootstrap=10000, notch=1)
18061806
ax1.set_ylim((-5, 5))
1807-
1807+
18081808
fig2, ax2 = plt.subplots()
18091809
ax2.boxplot([x, x], bootstrap=10000, notch=1, autorange=True)
18101810
ax2.set_ylim((-5, 5))
@@ -4312,6 +4312,13 @@ def test_date_timezone_x_and_y():
43124312
plt.plot_date(time_index, time_index, tz='US/Eastern', ydate=True)
43134313

43144314

4315+
@cleanup
4316+
def test_large_offset():
4317+
fig, ax = plt.subplots()
4318+
ax.plot((1 + np.array([0, 1.e-12])) * 1.e27)
4319+
fig.canvas.draw()
4320+
4321+
43154322
if __name__ == '__main__':
43164323
import nose
43174324
import sys

‎lib/matplotlib/ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,9 @@ def _set_offset(self, range):
551551
if np.absolute(ave_oom - range_oom) >= 3: # four sig-figs
552552
p10 = 10 ** range_oom
553553
if ave_loc < 0:
554-
self.offset = (math.ceil(np.max(locs) / p10) * p10)
554+
self.offset = (np.ceil(np.max(locs) / p10) * p10)
555555
else:
556-
self.offset = (math.floor(np.min(locs) / p10) * p10)
556+
self.offset = (np.floor(np.min(locs) / p10) * p10)
557557
else:
558558
self.offset = 0
559559

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.