Skip to content

Commit ea693b7

Browse files
committed
Removes OldScalarFormatter
1 parent f7e0548 commit ea693b7

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

examples/pylab_examples/newscalarformatter_demo.py

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
11
import matplotlib.pyplot as plt
22
import numpy as np
3-
from matplotlib.ticker import OldScalarFormatter, ScalarFormatter
3+
from matplotlib.ticker import ScalarFormatter
44

55
# Example 1
66
x = np.arange(0, 1, .01)
77
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(2, 2, figsize=(6, 6))
8-
fig.text(0.5, 0.975, 'The old formatter',
9-
horizontalalignment='center', verticalalignment='top')
10-
ax1.plot(x * 1e5 + 1e10, x * 1e-10 + 1e-5)
11-
ax1.xaxis.set_major_formatter(OldScalarFormatter())
12-
ax1.yaxis.set_major_formatter(OldScalarFormatter())
13-
14-
ax2.plot(x * 1e5, x * 1e-4)
15-
ax2.xaxis.set_major_formatter(OldScalarFormatter())
16-
ax2.yaxis.set_major_formatter(OldScalarFormatter())
17-
18-
ax3.plot(-x * 1e5 - 1e10, -x * 1e-5 - 1e-10)
19-
ax3.xaxis.set_major_formatter(OldScalarFormatter())
20-
ax3.yaxis.set_major_formatter(OldScalarFormatter())
21-
22-
ax4.plot(-x * 1e5, -x * 1e-4)
23-
ax4.xaxis.set_major_formatter(OldScalarFormatter())
24-
ax4.yaxis.set_major_formatter(OldScalarFormatter())
25-
26-
fig.subplots_adjust(wspace=0.7, hspace=0.6)
27-
28-
# Example 2
29-
x = np.arange(0, 1, .01)
30-
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(2, 2, figsize=(6, 6))
318
fig.text(0.5, 0.975, 'The new formatter, default settings',
329
horizontalalignment='center',
3310
verticalalignment='top')
@@ -50,7 +27,7 @@
5027

5128
fig.subplots_adjust(wspace=0.7, hspace=0.6)
5229

53-
# Example 3
30+
# Example 2
5431
x = np.arange(0, 1, .01)
5532
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(2, 2, figsize=(6, 6))
5633
fig.text(0.5, 0.975, 'The new formatter, no numerical offset',
@@ -75,7 +52,7 @@
7552

7653
fig.subplots_adjust(wspace=0.7, hspace=0.6)
7754

78-
# Example 4
55+
# Example 3
7956
x = np.arange(0, 1, .01)
8057
fig, [[ax1, ax2], [ax3, ax4]] = plt.subplots(2, 2, figsize=(6, 6))
8158
fig.text(0.5, 0.975, 'The new formatter, with mathtext',

0 commit comments

Comments
 (0)